Part Number Hot Search : 
BUL68B 3906L SPX29150 X9C303PI MTRPB P2804BDG UPC1394C DE1747
Product Description
Full Text Search
 

To Download Z86L990 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  zilog worldwide headquarters ? 532 race street ? san jose, ca 95126-3432 telephone: 408.558.8500 ? fax: 408.558.8300 ? www.zilog.com preliminary product specification ps003807-1002 z86d990/z86d991 otp and z86l99x rom low-voltage micro- controllers with adc
p r e l i m i n a r y ps003807-1002 this publication is subject to replacement by a later edition. to determine whether a later edition exists, or to request copies of publications, contact: zilog worldwide headquarters 532 race street san jose, ca 95126-3432 telephone: 408.558.8500 fax: 408.558.8300 www.zilog.com zilog is a registered trademark of zilog inc. in the united states and in other countries. all other products and/or service names mentioned herein may be trademarks of the companies with which they are associated. document disclaimer ? 2002 by zilog, inc. all rights reserved. information in this publication concerning the devices, applications, or technology described is intended to suggest possible uses and may be superseded. zilog, inc. does not assume liability for or provide a representation of accuracy of the information, devices, or technology described in this document. zilog also does not assume liability for intellectual property infringement related in any manner to use of information, devices, or technology described herein or otherwise. except with the express written approval zilog, use of information, devices, or technology as critical components of life support systems is not authorized. no licenses or other rights are conveyed, implicitly or otherwise, by this document under any intellectual property rights.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y iii table of contents architectural overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 counter/timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 input/output and interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 operating characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 user-programmable option bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 functional block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 pins configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 operational description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 central processing unit (cpu) description . . . . . . . . . . . . . . . . . . . . . . . . . . 9 memory (rom/otp and ram) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 clock circuit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 reset conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 i/o ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 control and status registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 register summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 register error conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 registers (grouped by function) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 standard test conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 dc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 analog-to-digital converter characteristics . . . . . . . . . . . . . . . . . . . . . . . . 89 ac characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 design considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 precharacterization product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y iv list of figures figure 1. functional block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 figure 2. 48-pin ssop pin assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 figure 3. 40-pin dip pin assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 figure 4. 28-pin soic/dip pin assignment?user mode . . . . . . . . . . . . . . . . 7 figure 5. program memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 figure 6. standard z8 register file (working reg. groups 0?f, bank 0) . . . 13 figure 7. z8 expanded register file architecture . . . . . . . . . . . . . . . . . . . . . 14 figure 8. interrupt block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 figure 9. external interrupt sources irq0?irq2 block diagram . . . . . . . . . . 17 figure 10. irq logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 figure 11. interrupt request timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 figure 12. general input/output pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 figure 13. analog comparators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 figure 14. adc block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 figure 15. low-pass filter (with 8-mhz crystal) . . . . . . . . . . . . . . . . . . . . . . . 30 figure 16. active glitch/power filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 figure 17. i-v characteristics for the current sink pad p43 . . . . . . . . . . . . . . 34 figure 18. t 1 counter/timer block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 figure 19. register file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 figure 20. prescaler 1 register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 figure 21. counter/timer 1 register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 figure 22. timer mode register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 figure 23. starting the count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 figure 24. counting modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 figure 25. timer mode register t out operation . . . . . . . . . . . . . . . . . . . . . . . 40 figure 26. counter/timer output using t out . . . . . . . . . . . . . . . . . . . . . . . . . 41 figure 27. internal clock output using t out . . . . . . . . . . . . . . . . . . . . . . . . . . 41 figure 28. timer mode register t in operation . . . . . . . . . . . . . . . . . . . . . . . . 42 figure 29. prescaler 1 t in operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 figure 30. external clock input mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 figure 31. gated clock input mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 figure 32. triggered clock mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 figure 33. counter/timer architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 figure 34. transmit mode flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y v figure 35. demodulation mode flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 figure 36. test load diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 figure 37. 48-pin ssop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 figure 38. 40-pin pdip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 figure 39. 28-pin pdip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 figure 40. 28-pin soic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y vi list of tables table 1. z86l99/z86d99 feature comparison . . . . . . . . . . . . . . . . . . . . . . . . 1 table 2. pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 table 3. interrupt types, sources, and vectors . . . . . . . . . . . . . . . . . . . . . . 15 table 4. interrupt edge select for external interrupts . . . . . . . . . . . . . . . . . . 17 table 5. control and status register reset conditions . . . . . . . . . . . . . . . . 20 table 6. clock status in operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . 22 table 7. special port pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 table 8. active glitch/filter specifications (preliminary) . . . . . . . . . . . . . . . . 32 table 9. current sink pad p43 specifications (preliminary) . . . . . . . . . . . . . 33 table 10. i/o port registers (group 0, bank 0, registers 0?f) . . . . . . . . . . . 52 table 11. timer control registers (group 0, bank d, registers 0?f) . . . . . . 53 table 12. control and status registers (group f, bank 0, registers 0?f) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 table 13. smr and port mode registers (group 0, bank f, registers 0?f) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 table 14. register description locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 table 15. flags register [group/bank f0h, register c (r252)] . . . . . . . . . 57 table 16. rp register [group/bank f0h, register d (r253)] . . . . . . . . . . . . . 58 table 17. sp register [group/bank f0h, register f (r255)] . . . . . . . . . . . . . 59 table 18. lb register (group/bank 0dh, register c) . . . . . . . . . . . . . . . . . . . 60 table 19. adcctrl register (group/bank 0fh, register 8) . . . . . . . . . . . . . 61 table 20. adcdata register (group/bank 00h, register 7) . . . . . . . . . . . . . 62 table 21. imr (group/bank 0fh, register b) . . . . . . . . . . . . . . . . . . . . . . . . . 63 table 22. ipr (group/bank 0fh, register 9) . . . . . . . . . . . . . . . . . . . . . . . . . 64 table 23. irq (group/bank 0fh, register a) . . . . . . . . . . . . . . . . . . . . . . . . . 65 table 24. p456con register (group/bank 0fh, register 0) . . . . . . . . . . . . . 67 table 25. p3m register [group/bank f0h, register 7 (r247)] . . . . . . . . . . . . 68 table 26. p2 register [group/bank 00h, register 2 (r2)] . . . . . . . . . . . . . . . 68 table 27. p2m register [group/bank f0h, register 6 (r246)] . . . . . . . . . . . . 68 table 28. p4 register [group/bank 00h, register 4 (r4)] . . . . . . . . . . . . . . . 69 table 29. p4m register (group/bank 0fh, register 2) . . . . . . . . . . . . . . . . . . 69 table 30. p5 register [group/bank 00h, register 5 (r5)] . . . . . . . . . . . . . . . 70 table 31. p5m register (group/bank 0fh, register 4) . . . . . . . . . . . . . . . . . . 70 table 32. p6 register [group/bank 00h, register 6 (r6)] . . . . . . . . . . . . . . . 71
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y vii table 33. p6m register (group/bank 0fh, register 6) . . . . . . . . . . . . . . . . . . 71 table 34. t1 register [group/bank f0h, register 2 (r242)] . . . . . . . . . . . . . 72 table 35. tmr register [group/bank f0h, register 1 (r241)] . . . . . . . . . . . . 72 table 36. pre1 register [group/bank f0h, register 3 (r243)] . . . . . . . . . . . 73 table 37. ctr1 register (in transmit mode) (group/bank 0dh, register 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 table 38. ctr1 register (in demodulation mode) (group/bank 0dh, register 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 table 39. ctr3 register (group/bank 0dh, register 3) . . . . . . . . . . . . . . . . 76 table 40. ctr0 register (group/bank 0dh, register 0) . . . . . . . . . . . . . . . . 77 table 41. hi8 register (group/bank 0dh, register b) . . . . . . . . . . . . . . . . . . 78 table 42. lo8 register (group/bank 0dh, register a) . . . . . . . . . . . . . . . . . . 78 table 43. tc8h register (group/bank 0dh, register 5) . . . . . . . . . . . . . . . . 79 table 44. tc8l register (group/bank 0dh, register 4) . . . . . . . . . . . . . . . . . 79 table 45. ctr2 register (group/bank 0dh, register 2) . . . . . . . . . . . . . . . . 80 table 46. hi16 register (group/bank 0dh, register 9) . . . . . . . . . . . . . . . . . 81 table 47. lo16 register (group/bank 0dh, register 8) . . . . . . . . . . . . . . . . . 81 table 48. tc16h register (group/bank 0dh, register 7) . . . . . . . . . . . . . . . 82 table 49. tc16l register (group/bank 0dh, register 6) . . . . . . . . . . . . . . . . 82 table 50. smr register (group/bank 0fh, register b) . . . . . . . . . . . . . . . . . 83 table 51. p2smr register (group/bank 0fh, register 1) . . . . . . . . . . . . . . . 84 table 52. p5smr register (group/bank 0fh, register 5) . . . . . . . . . . . . . . . 84 table 53. absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 table 54. dc characteristics for the z86d99x (otp only) . . . . . . . . . . . . . . 87 table 55. dc characteristics for the z86l99x (mask only) . . . . . . . . . . . . . . 88 table 56. analog-to-digital converter characteristics . . . . . . . . . . . . . . . . . . . 89 table 57. ac characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 1 architectural overview the z86d99 is a low-voltage general-purpose one-time programmable (otp) z8 ? microcontroller with an integrated four-channel 8-bit sigma delta analog-to-digital converter. the z86l99 is the read-only memory (rom) version of this controller. the z86d99/z86l99 family is designed to be used in a wide variety of embedded control applications including battery chargers, home appliances, infrared (ir) remote controls, security systems, and wireless keyboards. it has three counter/timers, a general-purpose 8-bit counter/timer with a 6-bit pres- caler and an 8-bit/16-bit counter/timer pair that can be used individually for gen- eral-purpose timing or as a pair to automate the generation and reception of complex pulses or signals. unique features of the z86d99/z86l99 family of prod- ucts include 489 bytes of general-purpose random-access memory (ram), 256 bytes of which are mapped into the program memory space and can be used to store data variables or as executable ram, a low-battery detection flag, and a controlled current output pin, which is a regulated current source that sinks a pre- defined current (i cco ). table 1 highlights the basic product features of these microcontrollers. the z8 microcontroller core offers more flexibility and performance than accumu- lator-based microcontrollers. all 256 general-purpose registers, including dedi- cated input/output (i/o) port registers, can be used as accumulators. this unique register-to-register architecture avoids accumulator bottlenecks for high code effi- ciency. the registers can be used as address pointers for indirect addressing, as index registers, or for implementing an on-chip stack. the z8 has a sophisticated interrupt structure and automatically saves the pro- gram counter and status flags on the stack for fast context-switching. speed of execution and smooth programming are also supported by a ?working register area? with short 4-bit register addresses. table 1. z86l99/z86d99 feature comparison pins i/o memory (bytes) operating voltage (v) adc timers watch-dog timer z86d990 40/48 32 32k otp 3.0?5.5 4 channel 3 yes z86d991 28 24 32k otp 3.0?5.5 ? 3 yes Z86L990 40/48 32 16k rom 2.3?5.5 4 channel 3 yes z86l991 28 24 16k rom 2.3?5.5 ? 3 yes z86l996 28 24 4k rom 2.3?5.5 ? 3 yes z86l997 28 24 8k rom 2.3?5.5 ? 3 yes
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 2 the z8 instruction set, consisting of 43 basic instructions, is optimized for high- code density and reduced execution time. it is similar in form to the zilog z80 instruction set. the eight instruction types and six addressing modes together with the ability to operate on bits, 4-bit nibbles or binary coded decimal (bcd) dig- its, 8-bit bytes, and 16-bit words, make for a code-efficient, flexible microcontroller. features ? four-channel, 8-bit sigma delta analog-to-digital (a/d) converter with external voltage references (not available in the 28-pin configuration) ? two independent analog comparators ? controlled current output ? 489 bytes of ram ? 233 bytes of general-purpose register-based ram ? 256 bytes of ram mapped into the program memory space that can be used as data ram or executable ram ? 32 kbytes of otp memory (z86d99x) ? 16 kbytes of rom (z86l99x) counter/timers ? special architecture to automate generation and reception of complex pulses or signals: ? programmable 8-bit counter/timer (t8) with two 8-bit capture registers and two 8-bit load registers ? programmable 16-bit counter/timer (t16) with one 16-bit capture register pair and one 16-bit load register pair ? programmable input glitch filter for pulse reception ? one general-purpose 8-bit counter/timer (t1) with 6-bit prescaler input/output and interrupts ? thirty-two i/os, twenty-nine of which are bidirectional i/os with programmable resistive pull-up transistors (24 i/os are available in the 28-pin configuration) ? sixteen i/os are selectable as stop-mode recovery sources ? six interrupt vectors with nine interrupt sources ? three external sources ? two comparator interrupts
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 3 ? three timer interrupts ? one low-battery detector flag operating characteristics ? 8-mhz operation ? 3.0 v to 5.5 v operating voltage (z86d990/z86d991) ? 2.3 v to 5.5 v operating voltage (Z86L990/z86l991) ? low power consumption with three standby modes: ? stop ? halt ? low voltage standby ? low-battery detection flag ? low-voltage protection circuit (also known as v bo , or voltage brownout, circuit) ? watch-dog timer and power-on reset circuits user-programmable option bits ? clock source?rc/other (lc, resonator, or crystal) ? watch-dog timer permanently enable ? 32-khz crystal ? port 20?27 pull-up resistive transistor ? port 40?42 pull-up resistive transistor ? port 44?47 pull-up resistive transistor ? port 50?51 pull-up resistive transistor ? port 54?57 pull-up resistive transistor ? port 60?63 pull-up resistive transistor (not available in z86d991/z86l991) ? port 64?67 pull-up resistive transistor (not available in z86d991/z86l991) ? p43 high impedance in stop mode (available in otp only) force p43 to output a 1 in the open-drain configuration
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 4 functional block diagram figure 1 shows the functional block diagram for the microcontrollers. figure 1. functional block diagram register file 256 x 8-bit z8 core v dd_padring *** v dd_core program memory ?? 256 bytes two analog comparators 16-bit c/t (modulation) mux 8-bit a/d? adc0/p44 adc1/p45 adc2/p46 adc3/p47 port 2 port 6 ** port 5 port 4 7 0 7 0 7 0 7 0 power filter 8 expanded register file 8 8-bit c/t (general) 8-bit c/t (carrier) v ref? v ref+ machine timing and instruction control xtal 1 xtal 2 *controlled current output * controlled current output p43 p53 cref2 cref1 p50 p52 cin2 cin1 p51 **p6 is only in the Z86L990/z86d990. ?adc is only in the Z86L990/z86d990. ??program memory is as follows: z86d990 32k otp z86d991 32k otp Z86L990 16k rom z86l991 16k rom ***in the 28-pin package, v dd_padring and v dd_core are bonded together.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 5 pin descriptions figure 2 through figure 4 show the pin names and locations. figure 2. 48-pin ssop pin assignments p62 p63 p25 p26 p27 nc av ss v ref- p44 p45 p46 p47 v ref+ av dd v dd_core v dd_padring xtal2 xtal1 nc p51 p52 p53 p54 p64 p61 p60 p24 p23 p22 nc nc p21 p20 p43 vss vss p42 p41 p40 p50 p56 nc nc p57 p55 p67 p66 p65 48 z86d990/ Z86L990 1 24 25 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 281 27 26 47 notes: 1. both v ss pins must be connected to ground. 2. nc is no connection to the die. 3. av dd must be connected to v dd_core and a 10- f capacitor for good a/d conversion. 4. power must be connected to v dd_padring . current passes to v dd_core through the internal power filter.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 6 figure 3. 40-pin dip pin assignment p62 p63 p25 p26 p27 av ss v ref? p44/adc0 p45/adc1 p46/adc2 p47/adc3 v ref+ avdd/v dd_core v dd_padring xtal2 xtal1 p51/cin1/captive timer input p52/cin2/t1 timer input (tin) p53/cref2 p54/cout1 p61 p60 p24 p23 p22 p21 p20 p43/combined t8 t16 output v ss p42 p41/t16 output p40/t8 output p50/cref1 p56/t1 timer output p57 p55/cout2 p67 p66 p65 p64 40 z86d990/ Z86L990 1 20 21 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 notes: 1. av dd must be connected to v dd_core and a 10- f capacitor for good a/d conversion. 2. power must be connected to v dd_padring . current passes to v dd_core through the internal power filter.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 7 figure 4. 28-pin soic/dip pin assignment?user mode pins configuration table 2 describes the pins. table 2. pin descriptions pin # symbol 28 pdip/soic 40 pdip 48 ssop direction description p20 24 34 40 i/o port 2 bit 0 p21 25 35 41 i/o port 2 bit 1 p22 26 36 44 i/o port 2 bit 2 p23 27 37 45 i/o port 2 bit 3 p24 28 38 46 i/o port 2 bit 4 p25 1 3 3 i/o port 2 bit 5 p26 2 4 4 i/o port 2 bit 6 p27 3 5 5 i/o port 2 bit 7 p40 19 29 34 i/o port 4 bit 0, t8 output p25 p26 p27 p44/adc0 p45/adc1 p46/adc2 p47/adc3 v dd * xtal2 xtal1 p51/cin1/capture timer input p52/cin2/t1 timer input p53/cref2 p54/cout1 p24 p23 p22 p21 p20 p43/combined t8 t16 output v ss ** p42 p41/t16 output p40/t8 output p50/cref1 p56/t1 timer output p57 p55/cout2 z86d991/ z86l991 28 27 26 25 24 23 22 21 20 19 18 17 16 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 notes: 1. p43 is a controlled current output. 2. p54, p55, p56, and p57 are high drive outputs. * v dd = v dd_core + v dd_padring + av dd
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 8 p41 20 30 35 i/o port 4 bit 1, t16 output p42 21 31 36 i/o port 4 bit 2 p43 23 33 39 output t8/t16 output, controlled current output p44 4 8 9 i/o port 4 bit 4, a/d channel 0* p45 5 9 10 i/o port 4 bit 5, a/d channel 1* p46 6 10 11 i/o port 4 bit 6, a/d channel 2* p47 7 11 12 i/o port 4 bit 7, a/d channel 3* p50, cref1 18 28 33 i/o port 5 bit 0, comparator 1 reference p51, cin1 11 17 20 i/o port 5 bit 1, capture timer input, irq 2 p52, cin2 12 18 21 input port 5 bit 2, timer 1 timer input, irq 0 p53, cref2 13 19 22 input port 5 bit 3, comparator 2 reference, irq 1 p54 14 20 23 i/o port 5 bit 4, high drive output p55 15 25 28 i/o port 5 bit 5, high drive output p56 17 27 32 i/o port 5 bit 6, timer 1 output, high drive output p57 16 26 29 i/o port 5 bit 7, high drive output p60 39 47 i/o port 6 bit 0 p61 40 48 i/o port 6 bit 1 p62 1 1 i/o port 6 bit 2 p63 2 2 i/o port 6 bit 3 p64 21 24 i/o port 6 bit 4 p65 22 25 i/o port 6 bit 5 p66 23 26 i/o port 6 bit 6 p67 24 27 i/o port 6 bit 7 xtal1 10 16 18 input crystal, oscillator clock xtal2 9 15 17 output crystal, oscillator clock av dd 13 14 analog power supply v dd_core 13 15 z8 core power supply av ss 6 7 analog ground v ref? 7 8 input a/d converter lower reference v ref+ 12 13 input a/d converter upper reference v dd_padring 8** 14 16 power supply (pad ring) v ss 22** 32 37, 38 ground notes: *a/d converter is not available in the 28-pin configuration. **in the 28-pin configuration, all three (core, pad ring, and analog) powers are tied together. table 2. pin descriptions (continued) pin # symbol 28 pdip/soic 40 pdip 48 ssop direction description
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 9 operational description central processing unit (cpu) description the z8 architecture is characterized by a flexible i/o scheme, an efficient register and address space structure and a number of ancillary features for cost-sensitive, high-volume embedded control applications. rom-based products are geared for high-volume production (where the software is stable) and one-time programma- ble equivalents for prototyping as well as volume production where time to market or code flexibility is critical. architecture type the z8 register-oriented architecture centers around an internal register file com- posed of 256 consecutive bytes, known as the standard register file. the standard register file consists of 4 i/o port registers (r2, r4, r5, and r6), 12 control and status registers, 233 general-purpose registers, and 7 registers reserved for future expansion. in addition to the standard register file, the z86d99/z86l99 family uses 21 control and status registers located in the z8 expanded register file. any general-purpose register can be used as an accumulator and address pointer or an index, data, or stack register. all active registers can be referenced or modified by any instruction that accesses an 8-bit register, without the requirement for special instructions. registers accessed as 16 bits are treated as even-odd register pairs. in this case, the data?s most significant byte (msb) is stored in the even-numbered register, while the least significant byte (lsb) goes into the next higher odd-numbered register. the z8 cpu has an instruction set designed for the large register file. the instruc- tion set provides a full compliment of 8-bit arithmetic and logical operations. bcd operations are supported using a decimal adjustment of binary values, and 16-bit quantities for addresses and counters can be incremented and decremented. bit manipulation and rotate and shift instructions complete the data-manipulation capabilities of the z8 cpu. no special i/o instructions are necessary because the i/o is mapped into the register file. cpu control registers the standard z8 control registers govern the operation of the cpu. any instruc- tion which references the register file can access these control registers. the fol- lowing are available control registers: ? register pointer (rp) ? stack pointer (sp) ? program control flags (flags)
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 10 ? interrupt control (ipr, imr, and irq) ? stop mode recovery (smr, p2smr, and p5smr) ? low-battery detect (lb) flag the z8 uses a 16-bit program counter (pc) to determine the sequence of current program instructions. the pc is not an addressable register. peripheral registers are used to transfer data, configure the operating mode, and control the operation of the on-chip peripherals. any instruction that references the register file can access the peripheral registers. the following are peripheral control registers: ? analog/digital converter (adcctrl and adcdata) ? t1 timer/counter (tmr, t1, and pre1) ? t8 timer/counter (ctr0, hi8, lo8, tc8h, and tc8l) ? t16 timer/counter (ctr2, hi16, lo16, tc16h, and tc16l) ? t8/t16 control registers (ctr1and ctr3) in addition, the four port registers are considered to be peripheral registers. the following are port control registers: ? port configuration registers (p456con and p3m) ? port 2 control and mode registers (p2 and p2m) ? port 4 control and mode registers (p4 and p4m) ? port 5 control and mode registers (p5 and p5m) ? port 6 control and mode registers (p6 and p6m) the functions and applications of the control and peripheral registers are explained in ?control and status registers? on page 52. memory (rom/otp and ram) there are four basic address spaces available to support a wide range of configu- rations: ? program memory (on-chip) ? standard register file ? expanded register file ? executable ram the z8 standard register file totals up to 256 consecutive bytes organized as 16 groups of 16 eight-bit registers. these registers consist of i/o port registers,
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 11 general-purpose ram registers, and control and status registers. every ram reg- ister acts like an accumulator, speeding instruction execution and maximizing cod- ing efficiency. working register groups allow fast context switching. the standard register file of the z8 (known as bank 0) has been expanded to form 16 expanded register file (erf) banks. the expanded register file allows for addi- tional system control registers and for the mapping of additional peripheral devices into the register area. each erf bank can potentially consist of up to 256 registers (the same amount as in the standard register file) that can then be divided into 16 working register groups. currently, only group 0 of erf banks f and d ( 0fh and 0dh ) has been implemented. in addition to the standard program memory and the ram register files, the z86d99/z86l99 family also has 256 bytes of executable ram that has been mapped into the upper 256 bytes of the program memory address space ( ff00h ? ffffh ). data can be written to the executable ram by using the ldc instruction. program memory structure the first 12 bytes of program memory are reserved for the interrupt vectors. these locations contain six 16-bit vectors that correspond to the six available interrupts (irq 0 through irq 5 .) address 12 ( 0ch ) up to 32,767 ( 7fffh ) consists of on-chip one-time programmable memory. the z86l99x only has the 4k/8k/16k rom size. after any reset operation (power-on reset, watch-dog timer time out, and stop mode recovery), program execution resumes with the initial instruction fetch from location 000ch . after a reset, the first routine executed must be one that initializes the control registers to the required system configuration. a unique feature of the z86d99/z86l99 family is the presence of 256 bytes of on- chip executable ram. this random-access memory is in addition to the standard z8 register file memory available on all z8 microcontrollers. as illustrated in figure 5, the executable ram is mapped into the upper 256 bytes of the 64k pro- gram memory address space ( ff00h ? ffffh ). data can be written to the execut- able ram by using the ldc instruction. memory locations between 8000h and feffh have not been implemented on the z86d99x microcontrollers. the z86d99/z86l99 family does not have the capability of accessing external memory.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 12 z8 standard register file (bank 0) bank 0 of the z8 expanded register file architecture is known as the standard reg- ister file of the z8. as shown in figure 6, the z8 standard register file consists of 16 groups of sixteen 8-bit registers known as working register (wr) groups. working register group f contains various control and status registers. the lower half of working register group 0 consists of i/o port registers (r0 to r7), the upper eight registers are available for use as general-purpose ram registers. working register group 1 through group e of the standard register file are avail- able to be used as general-purpose ram registers. the user can use 233 bytes of general-purpose ram registers in the standard z8 register file (bank 0). location (hex) ffff 256 bytes executable ram ff00 not implemented 3fff/7fff (rom)/(otp) program memory 000c location of the first byte of the initial instruction executed after reset 000b irq 5 (lower byte) 000a irq 5 (upper byte) 0009 irq 4 (lower byte) 0008 irq 4 (upper byte) 0007 irq 3 (lower byte) 0006 irq 3 (upper byte) 0005 irq 2 (lower byte) 0004 irq 2 (upper byte) 0003 irq 1 (lower byte) 0002 irq 1 (upper byte) 0001 irq 0 (lower byte) 0000 irq 0 (upper byte) figure 5. program memory map
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 13 figure 6. standard z8 register file (working reg. groups 0?f, bank 0) z8 expanded register file in addition to the standard z8 register file (bank 0), expanded register file banks f and d of working register group 0 have been implemented on the z86d99/z86l99. figure 7 illustrates the z8 expanded register file architecture. these two expanded register file banks of working register group 0 provide a total of 32 additional ram control and status registers. the z86d99/z86l99 fam- ily has implemented 21 of the 32 available registers. grp/bnk reg working register group function ( f0h ) r0 to 15 control and status registers ( e0h ) r0 to 15 general-purpose ram registers ( d0h ) r0 to 15 general-purpose ram registers ( c0h ) r0 to 15 general-purpose ram registers ( b0h ) r0 to 15 general-purpose ram registers ( a0h ) r0 to 15 general-purpose ram registers ( 90h ) r0 to 15 general-purpose ram registers ( 80h ) r0 to 15 general-purpose ram registers ( 70h ) r0 to 15 general-purpose ram registers ( 60h ) r0 to 15 general-purpose ram registers ( 50h ) r0 to 15 general-purpose ram registers ( 40h ) r0 to 15 general-purpose ram registers ( 30h ) r0 to 15 general-purpose ram registers ( 20h ) r0 to 15 general-purpose ram registers ( 10h ) r0 to 15 general-purpose ram registers r8 to 15 general-purpose ram registers ( 00h )r0 to 7 i/o port registers
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 14 figure 7. z8 expanded register file architecture clock circuit description the z8 derives its timing from on-board clock circuitry connected to pins xtal1 and xtal2. the clock circuitry consists of an oscillator, a divide-by-two shaping circuit, and a clock buffer. the oscillator?s input is xtal1, and the oscillator?s out- put is xtal2. the clock can be driven by a crystal, a ceramic resonator, lc clock, rc, or an external clock source. clock control the z8 offers software control of the internal system clock using programming register bits in the smr register. this register selects the clock divide value and determines the mode of stop mode recovery. the default setting is external clock divide-by-two. when bits 1 and 0 of the smr register are set to 0, the system clock (sclk) and timer clock (tclk) are equal to the external clock frequency divided by two. when bit 1 of the smr register is set to 1, then sclk and tclk equal the exter- nal clock frequency. refer to table 53 on page 85 for the maximum clock fre- quency. a divide-by-16 prescaler of sclk and tclk allows the user to selectively reduce device power consumption during normal processor execution (under sclk con- trol) and/or halt mode, where tclk sources counter/timers and interrupt logic. combining the divide-by-two circuitry with the divide-by-16 prescaler allows the external clock to be divided by 32. z8 standard register file f e d c b a 9 8 7 6 5 4 3 2 1 0 bank 0 control and status reg. i/o port registers working register groups banks 2 through c are reserved?not implemented group 0, bank d group 0, bank f (bank e is also reserved) general-purpose ram registers z8 expanded register files timer control registers stop mode recovery and port mode bank f registers
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 15 interrupts the z86d99/z86l99 family allows up to six different interrupts, three external and three internal, from nine possible sources. the six interrupts are assigned as fol- lows: ? three edge-triggered external interrupts (p51, p52, and p53), two of which are shared with the two analog comparators ? one internal interrupt assigned to the t8 timer ? one internal interrupt assigned to the t16 timer ? one internal interrupt shared between the low-battery detect flag and the t1 timer table 3 presents the interrupt types, the interrupt sources, and the location of the specific interrupt vectors. these interrupts can be masked and their priorities set by using the interrupt mask register (imr) and interrupt priority register (ipr) (figure 8.) when more than one interrupt is pending, priorities are resolved by a priority encoder, con- trolled by the ipr. table 3. interrupt types, sources, and vectors name source vector location comments irq 0 p52 (f/r), comparator 2 0,1 external interrupt (p52) is triggered by either rising or falling edge; internal interrupt generated by comparator 2 is mapped into irq 0 irq 1 p53 (f) 2,3 external interrupt (p53) is triggered by a falling edge irq 2 p51 (r/f), comparator 1 4,5 external interrupt (p51) is triggered by either a rising or falling edge; internal interrupt generated by comparator 1 is mapped into irq 2 irq 3 t16 timer 6,7 internal interrupt irq 4 t8 timer 8,9 internal interrupt irq 5 lvd, t1 timer 10,11 internal interrupt, lvd flag is multiplexed with t1 timer end-of- count interrupt notes: f = falling-edge triggered; r = rising-edge triggered. when lvd is enabled, irq5 is triggered only by low-voltage detection. timer 1 does not generate an interrupt.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 16 figure 8. interrupt block diagram interrupt requests are stored in the interrupt request register (irq), which can also be used for polling. when an interrupt request is granted, the z8 enters an ?interrupt machine cycle? that globally disables all other interrupts, saves the pro- gram counter (the address of the next instruction to be executed) and status flags, and finally branches to the vector location for the interrupt granted. it is only at this point that control passes to the interrupt service routine for the specific interrupt. all six interrupts can be globally disabled by resetting the master interrupt enable (bit 7 of the imr) with a disable interrupts (di) instruction. interrupts are globally enabled by setting the same bit with an enable interrupts (ei) instruction. descriptions of three interrupt control registers?the interrupt request register, the interrupt mask register, and the interrupt priority register?are provided in ?register summary? on page 52. the z8 family supports both vectored and polled interrupt handling. external interrupt sources external sources involve interrupt request lines p51, p52, and p53 (irq 2 , irq 0 , and irq 1 , respectively.) irq 0 , irq 1 , and irq 2 are generated by a transition on the corresponding port pin. as shown in figure 9, when the appropriate port pin (p51, p52, or p53) transitions, the first flip-flop is set. the next two flip-flops syn- chronize the request to the internal clock and delay it by two internal clock peri- ods. the output of the most recent flip-flop (irq 0 , irq 1 , or irq 2 ) sets the corresponding interrupt request register bit. ei instruction power-on reset (por) s r interrupt request register (irq,fah) reset
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 17 figure 9. external interrupt sources irq 0 ?irq 2 block diagram the programming bits for the interrupt edge select function are located in the irq register, bits 6 and 7. the configuration of these bits and the resulting interrupt edge is shown in table 4. although interrupts are edge triggered, minimum interrupt request low and high times must be observed for proper operation. see ?electrical characteristics? on page 85 for exact timing requirements (t w il, t w ih) on external interrupt requests. internal interrupt sources internal sources are ored with the external sources, so that either an internal or external source can trigger the interrupt. interrupt request register logic and timing figure 10 shows the logic diagram for the interrupt request register. the leading edge of an interrupt request sets the first flip-flop. it remains set until the interrupt requests are sampled. table 4. interrupt edge select for external interrupts interrupt request register interrupt edge bit 7 bit 6 irq 2 (p51) irq 0 (p52) 0 0 falling falling 0 1 falling rising 1 0 rising falling 1 1 rising/falling rising/falling note:
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 18 figure 10. irq logic internal interrupt requests are sampled during the most recent clock cycle before an op code fetch (see figure 11.) external interrupt requests are sampled two internal clocks earlier than internal interrupt requests because of the synchroniz- ing flip-flops shown in figure 9. figure 11. interrupt request timing at sample time, the interrupt request is transferred to the second flip-flop shown in figure 10, which drives the interrupt mask and priority logic. when an interrupt cycle occurs, this flip-flop is reset only for the highest priority level that is enabled. the user has direct access to the second flip-flop by reading and writing to the irq. the irq is read by specifying it as the source register of an instruction, and the irq is written by specifying it as the destination register. interrupt initialization after reset, all interrupts are disabled and must be re-initialized before vectored or polled interrupt processing can begin. the interrupt priority register, interrupt mask register, and interrupt request register must be initialized, in that order, to
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 19 start the interrupt process. however, the ipr does not have to be initialized for polled processing. interrupts must be globally enabled using the ei instruction. setting bit 7 of the imr is not sufficient. subsequent to this ei instruction, interrupts can be enabled either by imr manipulation or by use of the ei instruction, with equivalent effects. additionally, interrupts must be disabled by executing a di instruction before the iprs or imrs can be modified. interrupts can then be enabled by executing an ei instruction. irq software interrupt generation irq can be used to generate software interrupts by specifying irq as the destina- tion of any instruction referencing the z8 standard register file. these software interrupts (swis) are controlled in the same manner as hardware-generated requests (the ipr and the imr control the priority and enabling of each swi level). to generate a swi, the request bit in the irq is set as follows: or irq, # number where the immediate data, number , has a 1 in the bit position corresponding to the appropriate level of the swi. for example, for an swi on irq5, number has a 1 in bit 5. with this instruction, if the interrupt system is globally enabled, irq5 is enabled, and there are no higher priority pending requests, control is transferred to the service routine pointed to by the irq5 vector. reset conditions a system reset overrides all other operating conditions and puts the z8 into a known state. the control and status registers are reset to their default conditions after a power-on reset (por) or a watch-dog timer (wdt) time-out while in run mode. the control and status registers are not reset to their default conditions after stop mode recovery (smr) while in halt or stop mode. general-purpose registers are undefined after the device is powered up. reset- ting the z8 does not affect the contents of the general-purpose registers. the reg- isters keep their most recent value after any reset, as long as the reset occurs in the specified v cc operating range. registers do not keep their most recent state from a v lv reset, if v cc drops below v ram (see table 54 on page 87). following a reset (see table 5), the first routine executed must be one that initial- izes the control registers to the required system configuration.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 20 table 5. control and status register reset conditions address reset value register function grp/bnk register symbol r/w 76543210 register pointer f0h r13 (r253) rp r/w00000000 stack pointer f0h r15 (r255) sp r/wxxxxxxxx program control flags f0h r12 (r252) flags r/wxxxxxxxx low battery detect 0dh r12 lb r/w11111x00 adc control 0fh r8 adcctrl r/w 00000000 adc data 00h r7 (r7) adcdata r 00000000 interrupt mask f0h r11 (r251) imr r/w00000000 interrupt priority f0h r9 (r249) ipr w 00000000 interrupt request f0h r10 (r250) irq r/w00000000 port configuration (a) 0fh r0 p456con r/w00000111 port configuration (b) f0h r7 (r247) p3m w 11111111 port 2 data 00h r2 (r2) p2 r/wxxxxxxxx port 2 mode f0h r6 (r246) p2m w 11111111 port 4 data 00h r4 (r4) p4 r/wxxxxxxxx port 4 mode 0fh r2 p4m r/w11111**111 port 5 data 00h r5 (r5) p5 r/wxxxxxxxx port 5 mode 0fh r4 p5m r/w11111111 port 6 data 00h r6 (r6) p6 r/wxxxxxxxx port 6 mode 0fh r6 p6m r/w11111111 t1 timer data f0h r2 (r242) t1 r/w00000000 t1 timer mode f0h r1 (r241) tmr r/w00000011 t1 timer prescale f0h r3 (r243) pre1 r/w00000000 t8/t16 control (a) 0dh r1 ctr1 r/w000*0*0000 t8/t16 control (b) 0dh r3 ctr3 r/w0 0 0*xxxxx t8 timer control 0dh r0 ctr0 r/w0 0 0*0*0*0*0*0 t8 high capture 0dh r11 hi8 ? rw00000000 t8 low capture 0dh r10 lo8 ? r/w00000000 t8 high load 0dh r5 tc8h ? r/w00000000 t8 low load 0dh r4 tc8l ? r/w00000000 t16 timer control 0dh r2 ctr2 r/w00000000 t16 high capture 0dh r9 hi16 ? r/w00000000 t16 low capture 0dh r8 lo16 ? r/w00000000 t16 high load 0dh r7 tc16h ? r/w00000000 t16 low load 0dh r6 tc16l ? r/w00000000
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 21 power-on reset a por (cold start) always resets the z8 control and status registers to their default conditions. a por sets bit 7 of the stop mode recovery register to 0 to indicate that a cold start has occurred. a timer circuit clocked by a dedicated on-board rc oscillator is used for the power-on reset timer (tpor) function. the por time is specified as t por . t por time allows v cc and the oscillator circuit to stabilize before instruction exe- cution begins. the por delay timer circuit is a one-shot timer triggered by one of three condi- tions: ? power fail to power ok status including recovery from low voltage (v lv) standby mode ? stop-mode recovery (when bit 5 of the smr register = 1) ? wdt time-out under normal operating conditions, a stop mode recovery event always triggers the por delay timer. this delay is necessary to allow the external oscillator time to stabilize. when using an rc or lc oscillator (with a low q factor), the shorter wake-up time means the delay can be eliminated. bit 5 of the smr register selects whether the por timer delay is used after stop- mode recovery or is bypassed. if bit 5 =1, then the por timer delay is used. if bit 5 = 0, then the por timer delay is bypassed. in this case, the smr source must be held in the recovery state for 5 tpc to pass the reset signal internally. watch-dog timer (wdt) the wdt is a retriggerable one-shot timer that resets the z8 if it reaches its terminal count. when operating in the run modes, a wdt reset is functionally stop mode recovery 0fh r11 smr r/w00100000 port 2 smr source 0fh r1 p2smr r/w00000000 port 5 smr source 0fh r5 p5smr r/w00000000 notes: ? this register is not reset following stop mode recovery (smr). *this bit is not reset following smr. x means this bit is undefined at por and is not reset following smr. **in otp, the default for p43 is open-drain output at power up; you need to initialize the p43 data. in the mask part, the p43 output is disabled until it is configured as output. table 5. control and status register reset conditions (continued) address reset value register function grp/bnk register symbol r/w 76543210
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 22 equivalent to a hardware por reset. if the mask option of the permanently enabled watch-dog timer is selected, it runs when power up. if the option is not selected, the wdt is initially enabled by executing the wdt instruction and refreshed on subsequent executions of the wdt instruction. the wdt instruction does not affect the zero (z), sign (s), and overflow (v) flags. permanently enabled wdts are always enabled, and the wdt instruction is used to refresh it. the wdt cannot be disabled after it has been initially enabled. the wdt is off during both halt and stop modes. the wdt circuit is driven by an on-board rc oscillator. the time-out period for the wdt is fixed to a typical value (see table 57 on page 90). power management in addition to the standard run mode, the z8 supports three power-down modes to minimize device current consumption. the following three modes are sup- ported: ? halt ? stop ? low-voltage standby table 6 shows the status of the internal cpu clock (sclk), the internal timer clock (tclk), the external oscillator, and the watch-dog timer during the run mode and three low-power modes. using the power-down modes in order to enter halt or stop mode, it is necessary to first flush the instruction pipeline to avoid suspending execution in mid-instruction. you can flush the table 6. clock status in operating modes operating mode sclk tclk external osc wdt* run on on on on halt off on on off stop off off off off low-voltage standby off off off off note: * when wdt is enabled by the mask option bit
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 23 instruction pipeline by executing a nop (op code = ffh ) immediately before the appropriate sleep instruction. for example: or halt halt mode suspends instruction execution and turns off the internal cpu clock (sclk). the on-chip oscillator circuit remains active, so the internal timer clock (tclk) continues to run and is applied to the counter/timers and interrupt logic. an interrupt request, either internally or externally generated, must be executed (enabled) to exit halt mode. after the interrupt service routine, the program con- tinues from the instruction immediately following the halt. the halt mode can also be exited by a por. in this case, the program execution restarts at the reset address 000ch . stop stop mode provides the lowest possible device standby current. this instruction turns off both the internal cpu clock (sclk) and internal timer clock (tclk) and reduces the standby current to the minimum. the stop mode is terminated by a por or smr source. terminating the stop mode causes the processor to restart the application program at address 000ch . when the stop instruction is executed, the microcontroller goes into the stop mode despite any state/change of the state of the port. the ports need to be checked immediately before the nop and stop instructions to ensure the right input logic before waiting for the change of the ports. stop mode recovery sources exiting stop mode using an smr source is greatly simplified in the z86d99/ z86l99 family. the z86d99/z86l99 family of products allows 16 individual i/o mnemonic comment op code nop ; clear the pipeline ffh stop ; enter stop mode 6fh mnemonic comment op code nop ; clear the pipeline ffh halt ; enter halt mode 7fh note:
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 24 pins (ports 2 and 5) to be used as stop-mode recovery sources. the stop mode is exited when one of these smr sources is toggled. a transition from either low to high or high to low on any pin of port 2 or port 5 if the pin is identified as an smr source will effect an smr. there are three registers that control stop mode recovery: ? stop mode recovery ? port 2 stop mode recovery (p2smr) ? port 5 stop mode recovery (p5smr) the functions and applications of these registers are explained in ?stop-mode recovery control registers? on page 82. low-voltage standby an on-chip voltage comparator checks that the v cc level is at the required level for correct operation of the z8. when v cc falls below the low-voltage trip voltage (v lv ), reset is globally driven, and then the device is put in a low-current standby mode with the external oscillator stopped. if the v cc remains above v ram , the ram content is preserved. when the power level rises above the v lv level, the device performs a por and functions normally. the minimum operating voltage varies with temperature and operating frequency, while v lv varies with temperature only. i/o ports the z86d99/z86l99 family has up to 32 lines dedicated to input and output in the 40-pin configuration. these lines are grouped into four 8-bit ports known as port 2, port 4, port 5, and port 6. all four ports are bit programmable as either inputs or outputs with the exception of p52, p53, and p43. p52 and p53 are input only as they are used in otp programming. p43 is the controlled current output and is therefore output only. all ports have push-pull cmos outputs. in addition, the push-pull outputs can be turned off for open-drain operation using the p456con register. internal resistive pull-up transistors are available as a user-defined otp/mask option on all ports. for ports 4, 5, and 6, the pull-ups are nibble selectable. for port 2, the pull-up option applies to all eight i/o lines. internal pull-ups are disabled on any given pin or group of port pins when those pins are programmed as outputs. note:
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 25 mode registers each port has an associated mode register that determines the port?s functions and allows dynamic change in port functions during program execution. port and mode registers are mapped into the standard register file. because of their close association, port and mode registers are treated like any other general-pur- pose register. there are no special instructions for port manipulation. any instruc- tion that addresses a register can address the ports. data can be directly accessed in the port register, with no extra moves. input and output registers each of the four ports (ports 2, 4, 5, and 6) has an input register, an output regis- ter, and associated buffer and control logic. because there are separate input and output registers associated with each port, writing bits defined as inputs store the data in the output register. this data cannot be read as long as the bits are defined as inputs. however, if the bits are reconfigured as output, the data stored in the output register is reflected on the output pins and can then be read. this mecha- nism allows the user to initialize the outputs before driving their loads. because port inputs are asynchronous to the z8 internal clock, a read operation could occur during an input transition. in this case, the logic level might be uncer- tain (somewhere between a logic 1 and 0). general port i/o the eight i/o lines of each port (except p43, p52, and p53) can be configured under software control to be either input or output, independently. bits pro- grammed as outputs can be globally programmed as either push-pull or open- drain. see figure 12.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 26 figure 12. general input/output pin read/write operations the ports are accessed as general-purpose registers. port registers are written by specifying the port register as an instruction?s destination register. writing to a port causes data to be stored in the output register of the port, and reflected externally on any bit configured as an output. ports are read by specifying the port register as the source register of an instruc- tion. when an output bit is read, data on the external pin is returned. under normal loading conditions, returning data on the external pin is equivalent to reading the output register. however, if a bit is defined as an open-drain output, the data returned is the value forced on the output pin by the external system. this value might not be the same as the data in the output register. reading input bits also returns data on the external pins. open-drain i/o otp/mask option v cc * pad out in pull-up note: * pull-up resistance is about 200 k ? at 2.3 v and 75 k ? at 5.0 v with + 50% tolerance.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 27 special functions table 7 defines the special functions of ports 4 and 5. table 7. special port pin functions function pin signal configuration register analog comparator inputs p51 cin1 p456con p52 cin2 p456con analog comparator references p50 cref1 p53 cref2 analog comparator outputs p54 cout1 p55 cout2 adc channels p44 adc0 adcctrl p45 adc1 adcctrl p46 adc2 adcctrl p47 adc3 adcctrl external interrupts p52 irq 0 imr and irq p53 irq 1 imr and irq p51 irq 2 imr and irq t in external clock input p52 t in tmr and pre1 capture timer input p51 demodulator_input ctr1 t1 timer output p56 t1out tmr t8 output p40 p40_out ctr0 t16 output p41 p41_out ctr2 combined t8/t16 output controlled current output p43 p43_out ctr1 zilog test mode p41 dsn enable p456con p42 asn enable p456con
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 28 peripherals analog comparators the z86d99/z86l99 family includes two independent on-chip general-purpose analog comparators as shown in figure 13. the comparators are multiplexed with a digital input signal by the p456con register. they can also be used to generate interrupts irq0 and irq2. the comparators are turned off in stop mode. figure 13. analog comparators analog/digital converter (adc) the z86d99/z86l99 family incorporates an 8-bit adc that uses a sigma delta architecture (figure 14) comprised of a modulator and a digital filter. the input is selected (bit 3,2 from adcctrl) with an analog mux from 4 (p47?p44) pins that can be configured as analog inputs (bit 7?4 from adcctrl). whenever an input pin has an analog value, the digital input buffer has to be disabled in order to reduce the current through the device. + ? + ? p51 comparator 1 p50 p52 comparator 2 p53 p456con p456con irq2, p51 data latch irq0, p52 data latch (cin1) (cref1) (cin2) (cref2) bit4 1 = comparator 0 = digital bit5 1 = comparator 0 = digital note:
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 29 figure 14. adc block diagram the low-pass filter transfer function is presented in figure 15 with the ?3-db fre- quency given by the formula: where f adc is the sampling frequency of the modulator. f 3 db 0.0021 f adc ? =
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 30 figure 15. low-pass filter (with 8-mhz crystal) the sampling frequency of the modulator f adc can be selected between f sclk and f sclk /2 (bit1 from adcctrl). reducing the clock frequency lowers the power dissipated in the adc block. the adc can be enabled or disabled. when enabled, the ? converter tracks the input voltage. when switching between the channels (step response), the required time to reach the final value is given by the time constant of the low-pass filter: when available, the reference for the adc is set externally with the v ref+ and v ref- pins. the output code represents the following ratio: 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 20 18 16 14 12 10 8 6 4 2 0 filter response log10(f) out/in[db] t delay 2 f 3 db -------- - 2 0.0021 f adc --------------------------- - 952 f adc ---------- - == = d out v in v ref - ? v ref + v ref - ? ------------------------------ - 256 =
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 31 though the adc functions for smaller input voltage range (v ref+ ?v ref- ), the noise and offsets remain constant over the specified electrical range. the errors of the converter increase due to small input signals. for fast access to the output of the adc, the current data is available in the adc result register (r8, bank00). to reduce the interference between the digital part and the analog part, separate av ss and av dd pins are available on the packages where the adc can be used. in the smaller packages, which do not support the adc, the user must keep the converter not active in order to not have power dissipated in the adc block. by default, adc is off. active glitch filter the z86d99/z86l99 family incorporates an active power/glitch filter that can be used to improve the quality of the power supply when the device is operating in noisy environments. the chips use three separate power buses: ? pad ring power bus (all the output drivers plus the crystal/rc oscillator) called v dd_padring ? core power bus (all digital circuitry) called v dd_core ? analog power bus (all analog circuitry) called av dd depending on the pin availability, one or more of the power buses are connected together. the active power filter can be used in the packages that have the v dd separate. figure 16 shows the internal schematic. note:
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 32 z86d99/z86l99 figure 16. active glitch/power filter when the internal power/glitch filter is not used, both v dd_padring and v dd_core must be connected together externally to the power supply. when the internal circuitry is used, the v dd_padring has to be connected to the power supply and the v dd_core has to be connected to an external energy stor- age capacitor (1 ?10 f range). the core is connected only to this capacitor during power supply glitches. table 8 describes the active glitch/filter specifications. on the wafer level, all three power buses are available. depending on the number of pins of the package, one or more power buses are connected together. the active glitch/power filter effectively increases the noise immunity for battery- operated designs where the controller is driving high current loads (for example, ir led). table 8. active glitch/filter specifications (preliminary) parameter max min condition diff. stage gain 75 db diff. stage bandwidth 15 mhz rise time 255 ns 50 mv pulse fall time 214 ns 50 mv pulse r dson 10 ? v dd_padring
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 33 controlled current output p43 is an open-drain output-only pin on the z86d990/d991, but it can be config- ured as output or tristate high impedance on the Z86L990/l991. to function properly, bit 3 of p4m must be set to zero to configure the pin as an open-drain output. for the Z86L990/l991 after reset, p43 defaults to tristate high impedance while the z86d990/d991 p43 is always configured as output. the data at port 4 must be initialized as it is undefined at power-on reset. the current output is a controlled current source that is controlled by the output of the value of p43 (see table 9). p43 cannot be configured as input, and if p43 is read, p43 always returns the state of the output value (1 for no sink and 0 for sink). p43 uses internal current reference and will draw current if it outputs a low logic even without external connection. this applies to both run mode and stop mode. the pad driver can function in two modes: ? controlled current output, when the voltage on the pad is over a minimum value ? resistive pull down when the driver cannot regulate the current; in this mode, the gate of the nmos pull down is raised to the power rail. the i-v characteristics of the pad are presented in figure 17. table 9. current sink pad p43 specifications (preliminary) parameter min max conditions rise time 0.4 led load fall time 0.02 led load v outmin 0.54 v @27c comparator response 0.2 regulated current 80 ma 120 ma internal resistance 80 ? v pad v outmin >
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 34 figure 17. i-v characteristics for the current sink pad p43 the cpu reads the mode of the pad driver by reading bit number 2 from the lb register. this bit is the output of a set-reset flip-flop that sets whenever the volt- age on the pad is lower than v outmin and is reset by a cpu write to the respective register. t1 timer the z86d99/z86l99 family provides one general-purpose 8-bit counter/timer, t 1 , driven by its own 6-bit prescaler, pre 1 . the t 1 counter/timer is independent of the processor instruction sequence, which relieves software from time-critical opera- tions such as interval timing and event counting. the t 1 counter/timer operates in either single-pass or continuous mode. at the end-of-count, counting either stops or the initial value is reloaded and counting continues. under software control, new values are loaded immediately or when the end-of-count is reached. software also controls the counting mode, how the counter/timer is started or stopped, and the counter/timer?s use of i/o lines. both the counter and prescaler registers can be altered while the counter/timer is run- ning.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 35 counter/timer 1 is driven by a timer clock generated by dividing the internal clock by four. the divide-by-four stage, the 6-bit prescaler, and the 8-bit counter/timer form a synchronous 16-bit divide chain. counter/timer t 1 can also be driven by an external input (t in ) using port p52. port p5 6 can serve as a timer output (t out ) through which t 1 or the internal clock can be output. the timer output toggles at the end-of-count. figure 18 is a block diagram of the counter/timer. figure 18. t 1 counter/timer block diagram osc +2 +4 +2 external clock clock logic internal clock t in p3 1 8-bit down counter 6-bit down counter t1 initial value register pre1 initial value register t1 current value register internal data bus t out p5 6 irq5 internal clock gated clock triggered clock write write read
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 36 the counter/timer, prescaler, and associated mode registers are mapped into the register file as shown in figure 19. the software uses the counter/timer as a gen- eral-purpose register, which eliminates the need for special instructions. figure 19. register file prescaler and counter/timer the prescaler pre 1 ( f3h ) consists of an 8-bit register and a 6-bit down-counter as shown in figure 18 on page 35. the prescaler register is a read-write register. figure 20 shows the prescaler register. r243 pre1 prescaler 1 register ( f3h ; read/write) figure 20. prescaler 1 register dec hex identifiers 243 t1 prescaler f3 pre1 242 timer/counter 1 f2 t1 241 timer mode f1 tmr d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 count mode 1 = t 1 modulo-n 0 = t 1 single pass clock source 1 = t 1 internal 0 = t 1 external (t in ) prescaler modulo (range: 1?64 decimal, 01h ? 00h )
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 37 the six most significant bits (d 2 ?d 7 ) of pre 1 hold the prescaler count modulo, a value from 11 to 64 decimal. the prescaler register also contains control bits that specify t 1 counting modes. these bits also indicate whether the clock source for t 1 is internal or external. the counter/timer t 1 ( f2h ) consists of an 8-bit down-counter, a write-only register that holds the initial count value, and a read-only register that holds the current count value (see figure 18 on page 35). the initial value can range from 1 to 256 decimal ( 01h , 02h , ..., 00h ). figure 21 illustrates the counter/timer register. r242 t1 counter/timer 1 register ( f2h ; read/write) figure 21. counter/timer 1 register counter/timer operation under software control, t 1 is started and stopped using the timer mode register ( f1h ) bits d 2 ?d 3 : a load bit and an enable count bit. see figure 22. r241 tmr timer mode register ( f1h ; read/write) figure 22. timer mode register d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 initial value when written (range 1?256 decimal, 01h ? 00h ) current value when read d 3 d 2 d 1 d 0 reserved 0 = no function 1 = load t 1 0 = disable t 1 count 1 = enable t 1 count
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 38 load and enable count bits setting the load bit d 2 to 1 transfers the initial values in the prescaler and the counter/timer registers into their respective down-counters. the next internal clock resets bit d 2 to 0 , readying the load bit for the next load operation. the initial val- ues can be loaded into the down-counters at any time. if the counter/timer is run- ning, the counter/timer continues to run and starts the count over with the initial value. therefore, the load bit actually functions as a software re-trigger. the t 1 counter/timer remains at rest as long as the enable count bit d 3 is 0 . to enable counting, the enable count bit d 3 must be set to 1 . counting actually starts when the enable count bit is written by an instruction. the first decrement occurs four internal clock periods after the enable count bit has been set. the load and enable count bits can be set at the same time. for example, using the instruction or tmr #%0c sets both d 2 and d 3 of tmr to 1 . the initial values of pre 1 and t 1 are loaded into their respective counters, and the count is started after the m2t2 machine state after the operand is fetched as shown in figure 23. figure 23. starting the count prescaler operations during counting, the programmed clock source drives the prescaler 6-bit counter. the counter is counted down from the value specified by bits d 2 ?d 7 of the corre- sponding prescaler register, pre 0 or pre 1 (figure 24). when the prescaler counter reaches its end-of-count, the initial value is reloaded and counting contin- ues. the prescaler never actually reaches zero. for example, if the prescaler is set to divide by three, the count sequence is as follows: 3-2-1-3-2-1-3-2... m 3 m 1 m 2 m n t 1 t 2 t 3 t 1 t 2 t 3 t 1 t 2 t 3 t 1 t 2 t 3 #03 is fetched tmr is written; counter/timers are loaded first decrement occurs four clocks later
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 39 r243 pre1 prescaler 1 register ( f3h ; read/write) figure 24. counting modes when the pre 1 register is loaded with 000000 in the six most significant bits, the prescaler divides by 64. if that number is 000001, the prescaler does not divide and passes its clock on to t 1 . each time the prescaler reaches its end-of-count, a carry is generated, which allows the counter/timer to decrement by one on the next timer clock input. when t 1 and pre 1 both reach their end-of-count, an interrupt request is generated? irq 5 for t 1 . depending on the counting mode selected, the counter/timer either comes to rest with its value at 00h (single-pass mode), or the initial value is auto- matically reloaded and counting continues (continuous mode). in single-pass mode, the prescaler still continues to decrement when the timer t 1 has reached its end-of-count. the prescaler always starts from its programmed value upon restarting the counter. the counting modes are controlled by bit d 0 of pre 1 , with d 0 cleared to 0 for sin- gle-pass counting mode or set to 1 for continuous mode. the counter/timer can be stopped at any time by setting the enable count bit to 0 and restarted by setting the enable count bit back to 1 . the t 1 counter/timer con- tinues its count value at the time it was stopped. the current value in the t 1 counter/timer can be read at any time without affecting the counting operation. new initial values can be written to the prescaler or the counter/timer registers at any time. these values are transferred to their respective down-counters on the next load operation. if the counter/timer mode is continuous, the next load occurs on the timer clock following an end-of-count. new initial values must be written before the load operation because the prescaler always effectively operates in continuous count mode. if the value loaded in the t 1 register is 01h , the timer is actually not timing or counting at all; the timer is passing the prescaler end-of-count through. because the prescaler is continuously running, regardless of the single-pass/continuous mode operation, the 8-bit timer continuously times out at the rate of the prescaler end-of-count if the t 1 timer value is programmed to 01h . d 0 count mode 1 = t 1 modulo-n 0 = t 1 single pass
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 40 the time interval (i) until end-of-count, is given by i = t x p x v where t is 8 divided by xtal frequency, p is the prescaler value (1 ? 64), and v is the counter/timer value (1 ? 256). the prescaler and counter/timer are true divide- by-n counters. t out modes the timer mode register tmr ( f1h ) (figure 25) is used in conjunction with the port 5 mode register p5m to configure p5 6 for t out operation. in order for t out to function, p5 6 must be defined as an output line by setting p5m bit d 6 to 0 . output is controlled by one of the counter/timers (t 0 or t 1 ) or the internal clock. r241 tmr timer mode register ( f1h ; read/write) figure 25. timer mode register t out operation the p5 6 output is selected by tmr bits d 7 and d 6 . t 1 is selected by setting d 7 and d 6 to 1 and 0 , respectively. the counter/timer t out mode is turned off by set- ting tmr bits d 7 and d 6 both to 0 , freeing p3 6 to be a data output line. t out is initialized to a logic 1 whenever the tmr load bit d 2 is set to 1 . at end-of-count, the interrupt request line irq 5 clocks a toggle flip-flop. the out- put of this flip-flop drives the t out line p5 6 . in all cases, when the counter/timer reaches its end-of-count, t out toggles to its opposite state (see figure 26). if, for example, the counter/timer is in continuous counting mode, t out has a 50% duty cycle output. you can control the duty cycle by varying the initial values after each end-of-count. d 7 d 6 d 2 0 = no function 1 = load t 1 t out modes t out off = 00 reserved = 01 t 1 out = 10 internal clock out = 11
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 41 figure 26. counter/timer output using t out the internal clock can be selected as output instead of t 1 by setting tmr bits d 7 and d 6 both to 1 . the internal clock (xtal frequency/2) is then directly output on p5 6 (figure 27). figure 27. internal clock output using t out while programmed as t out , p5 6 cannot be modified by a write to port register p5. however, the z8 software can examine p5 6 ?s current output by reading the port register. t in modes the timer mode register tmr ( f1h ) (figure 28) is used in conjunction with the prescaler register pre 1 ( f3h ) (figure 29) to configure p5 2 as t in . t in is used in conjunction with t 1 in one of four modes: ? external clock input ? gated internal clock ? triggered internal clock ? retriggerable internal clock +2 p5 6 t out irq5 (t1 end-of-count) osc +2 internal clock p5 6 t out tmr tmr
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 42 r241 tmr timer mode register ( f1h ; read/write) figure 28. timer mode register t in operation r243 pre1 prescaler 1 register ( f3h ; write only) figure 29. prescaler 1 t in operation the t 1 counter/timer clock source must be configured for external by setting pre 1 bit d 2 to 0 . the timer mode register bits d 5 and d 4 can then be used to select the t in operation. for t 1 to start counting as a result of a t in input, the enable count bit d 3 in tmr must be set to 1 . when using t in as an external clock or a gate input, the initial values must be loaded into the down-counters by setting the load bit d 2 in tmr to 1 before counting begins. initial values are automatically loaded in trigger and retrigger modes, so software loading is unnecessary. configure p5 2 as an input line by setting p5m bit d 2 to 1 . d 5 d 4 t in modes external clock input = 00 gate input = 01 trigger input = 10 (non-retriggerable) trigger input = 11 (retriggerable) d 1 clock source 1 = t 1 internal 0 = t 1 external (t in )
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 43 each high-to-low transition on t in generates interrupt request irq 0 , regardless of the selected t in mode or the enabled/disabled state of t 1 . irq 0 must therefore be masked or enabled according to the needs of the application. external clock input mode the t in external clock input mode (tmr bits d 5 and d 4 both set to 0 ) supports the counting of external events, where an event is considered to be a high-to-low transition on t in (see figure 30) occurrence (single-pass mode) or on every nth occurrence (continuous mode) of that event. figure 30. external clock input mode gated internal clock mode the t in gated internal clock mode (tmr bits d 5 and d 4 set to 0 and 1 , respec- tively) measures the duration of an external event. in this mode, the t 1 prescaler is driven by the internal timer clock, gated by a high level on t in (see figure 31). t 1 counts while t in is high and stops counting when t in is low. interrupt request irq 0 is generated on the high-to-low transition of t in , signaling the end of the gate input. interrupt request irq 5 is generated if t 1 reaches its end-of-count. figure 31. gated clock input mode p5 2 d internal clock t1 irq5 t in clock d pre1 irq0 tmr d 5 ?d 4 = 00 p5 2 d internal clock +2 irq5 t in gate d osc irq0 tmr d 5 ?d 4 = 01 +4 t1 pre1
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 44 triggered input mode the t in triggered input mode (tmr bits d 5 and d 4 set to 1 and 0 , respectively) causes t 1 to start counting as the result of an external event (see figure 32). t 1 is then loaded and clocked by the internal timer clock following the first high-to-low transition on the t in input. subsequent t in transitions do not affect t 1 . in the sin- gle-pass mode, the enable bit is reset whenever t 1 reaches its end-of-count. fur- ther t in transitions have no effect on t 1 until software sets the enable count bit again. in continuous mode, when t 1 is triggered, counting continues until software resets the enable count bit. interrupt request irq 5 is generated when t 1 reaches its end-of-count. figure 32. triggered clock mode retriggerable input mode the t in retriggerable input mode (tmr bits d 5 and d 4 both set to 1 ) causes t 1 to load and start counting on every occurrence of a high-to-low transition on t in (see figure 32). interrupt request irq 5 is generated if the programmed time inter- val (determined by t 1 prescaler and counter/timer register initial values) has elapsed since the last high-to-low transition on t in . in single-pass mode, the end-of-count resets the enable count bit. subsequent t in transitions do not cause t 1 to load and start counting until software sets the enable count bit again. in continuous mode, counting continues when t 1 is triggered until software resets the enable count bit. when enabled, each high-to-low t in transition causes t 1 to p5 2 d internal clock +2 irq5 t in trigger d osc irq0 tmr d 5 ?d 4 = 11 +4 t1 pre1 edge trigger tmr d 5 = 1
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 45 reload and restart counting. interrupt request irq 5 is generated on every end-of- count. t8 and t16 timer operation the t8 timer is a programmable 8-bit counter/timer with two 8-bit capture regis- ters and two 8-bit load registers. the t16 timer is a programmable 16-bit counter/ timer with one 16-bit capture register pair and one 16-bit load register pair. see figure 33. the t8 and t16 counters/timers have two modes of operation: ? the transmit mode is used to generate complex waveforms. there are two submodes: ? the normal mode can be used in single-pass or modulo-n (repeating) mode. ? the ping-pong mode is used when the t8 timer counts down, enables the t16 timer that counts down, enabling t8, and so on, until the mode is disabled. ? the demodulation mode is used to capture and demodulate complex waveforms.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 46 figure 33. counter/timer architecture t8 transmit mode before t8 is enabled, the output of t8 depends on ctr1, d1. if ctr1, d1 is 0, t8_out is 1. if ctr1, d1 is 1, t8_out is 0. when t8 is enabled, the output t8_out switches to the initial value (ctr1 d1). if the initial value (ctr1 d1) is 0, tc8l is loaded; otherwise, tc8h is loaded into the counter. in single-pass mode (ctr0 d6), t8 counts down to 0 and stops, t8_out toggles, the time-out status bit (ctr0 d5) is set, and a time-out interrupt can be generated if it is enabled (ctr0 d1). in modulo-n mode, upon reaching terminal count, t8_out is toggled, but no interrupt is generated. then t8 loads a new count (if t8_out level is 0), tc8l is loaded; if t8_out is 1, tc8h is loaded. hi16 16-bit t16 8-bit t8 glitch filter edge detect circuit lo16 and/or logic timer 8/16 8 8 timer 16 timer 8 hi8 lo8 8 8 tc8h tc8l 8 8 tc16h tc16l 8 8 16 sclk clock divider t16 clocked input 1 2 4 8 sclk clock divider t8 clock divider 1 2 4 8
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 47 t8 counts down to 0, toggles t8_out, sets the time-out status bit (ctr0 d5), and generates an interrupt if enabled (ctr0 d1). this completes one cycle. t8 then loads from tc8h or tc8l, according to the t8_out level, and repeats the cycle. the user can modify the values in tc8h or tc8l at any time.the new values take effect when they are loaded. do not write these registers at the time the values are to be loaded into the counter/timer. an initial count of 1 is not allowed. an ini- tial count of 0 causes tc8 to count from 0 to ffh to feh . transition from 0 to ffh is not a time-out condition (see figure 34).
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 48 figure 34. transmit mode flowchart set time-out status bit (ctr0 d5) and generate timeout_int. if enabled set time-out status bit (ctr0 d5) and generate timeout_int. if enabled t8 (8-bit) transmit mode no t8_enable bit set ctr0 d7 yes ctr1 d1 value reset t8_enable bit 0 1 load tc8l reset t8_out load tc8h set t8_out enable t8 no t8_timeout ye s single pass single modulo-n t8_out value 0 enable t8 no t8_timeout yes disable t8 pass? load tc8h set t8_out load tc8l reset t8_out 1
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 49 do not use the same instructions for stopping the counter/ timers and setting the status bits. two successive commands are necessary?the first command for stopping counter/timers and the second command for resetting the status bits? because one counter/timer clock interval must complete for the initiated event to actually occur. t8 demodulation mode program tc8l and tc8h to ffh . after t8 is enabled, when the first edge (rising, falling, or both, depending on ctr1 d5, d4) is detected, it starts to count down. when a subsequent edge (rising, falling, or both, depending on ctr1 d5, d4) is detected during counting, the current value of t8 is one?s complemented and put into one of the capture registers. if t8 is a positive edge, data is placed in lo8. if t8 is a negative edge, data is placed in h18. one of the edge-detect status bits (ctr1 d1, d0) is set, and an interrupt can be generated if enabled (ctr0 d2). meanwhile, t8 is loaded with tc8h and starts counting again. if t8 reaches 0, the time-out status bit (ctr0 d5) is set, and an interrupt can be generated if enabled (ctr0 d1), and t8 continues counting from ffh (see figure 35). note:
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 50 figure 35. demodulation mode flowchart t8 (8-bit) demodulation mode t8 enable ctr0, d7 no yes ffh tc8 first edge present enable tc8 t8_enable bit set edge present t8 time out set edge present status bit and trigger data capture int. if enabled set time-out status bit and trigger time out int. if enabled continue counting disable tc8 no yes no yes yes yes no no
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 51 t16 transit mode in normal or ping-pong mode, the output of t16, when not enabled, is dependent on ctr1, d0. if ctr1, d0 is a 0, t16_out is a 1; if ctr1, d0 is a 1, t16_out is 0. the user can force the output of t16 to either a 0 or 1, whether it is enabled or not, by programming ctr1 d3, d2 to a 10 or 11. when t16 is enabled, tc16h * 256 + tc16l is loaded, and t16_out is switched to its initial value (ctr1 d0). when t16 counts down to 0, t16_out is toggled (in normal or ping-pong mode), an interrupt is generated if enabled (ctr2 d1), and a status bit (ctr2 d5) is set. if it is in modulo-n mode, it is loaded with tc16h * 256 + tc16l, and the counting continues. the user can modify the values in tc16h and tc16l at any time. the new values take effect when they are loaded. do not load these registers at the time the val- ues are to be loaded into the counter/timer. an initial count of 1 is not allowed. an initial count of 0 causes t16 to count from 0 to ffffh to fffeh . transition from 0 to ffffh is not a time-out condition. t16 demodulation mode program tc16l and tc16h to ffh . after t16 is enabled, when the first edge (ris- ing, falling, or both, depending on ctr1 d5, d4) is detected, t16 captures hi16 and lo16, reloads, and begins counting. ping-pong mode this operation mode is only valid in transmit mode. t8 and t16 must be pro- grammed in single-pass mode (ctr0 d6, ctr2 d6), and ping-pong mode must be programmed in ctr1 d3, d2. the user can begin the operation by enabling either t8 or t16 (ctr0 d7 or ctr2 d7). for example, if t8 is enabled, t8_out is set to this initial value (ctr1 d1). according to t8_out?s level, tc8h or tc8l is loaded into t8. after the terminal count is reached, t8 is disabled, and t16 is enabled. t16_out switches to its initial value (ctr1 d0), data from tc16h and tc16l is loaded, and t16 starts to count. after t16 reaches the terminal count, it stops. t8 is enabled again, and the whole cycle repeats. interrupts can be allowed when t8 or t16 reaches terminal control (ctr0 d1, ctr2 d1). to stop the ping- pong operation, write 00 to bits d3 and d2 or ctr1. enabling ping-pong operation while the counters/timers are running can cause intermittent counter/timer function. disable the counters/timers, then reset the status flags before starting the ping-pong mode. note:
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 52 control and status registers the z86d99/z86l99 family has 4 i/o port registers, 33 status and control regis- ters, and 233 general-purpose ram registers. the i/o port and control registers are included in the general-purpose register memory to allow any z8 instruction to process i/o or control information directly, thus eliminating the requirement for special i/o or control instructions. the z8 instruction set permits direct access to any of these 37 registers. in addition, each of the 233 general-purpose registers can also function as an accumulator, an address pointer, or an index register. registers identified as ?reserved? do not exist or have not been implemented in this design. register summary table 10 through table 13 summarize the name and location of all registers. the register-by-register descriptions follow this section. table 10. i/o port registers (group 0, bank 0, registers 0?f) grp/bnk reg register function identifier ( 00h )rf general-purpose ram register gpr ( 00h )re general-purpose ram register gpr ( 00h )rd general-purpose ram register gpr ( 00h )rc general-purpose ram register gpr ( 00h )rb general-purpose ram register gpr ( 00h )ra general-purpose ram register gpr ( 00h )r9 general-purpose ram register gpr ( 00h )r8 general-purpose ram register gpr ( 00h )r7 analog/digital converted data adcdata ( 00h )r6 port 6 control register p6 ( 00h )r5 port 5 control register p5 ( 00h )r4 port 4 control register p4 ( 00h )r3 reserved ( 00h )r2 port 2 control register p2 ( 00h )r1 reserved ( 00h )r0 reserved
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 53 table 11. control and status registers (group f, bank 0, registers 0?f) grp/bnk reg register function identifier ( f0h )rf stack pointer sp ( f0h )re general-purpose ram register gpr ( f0h )rd register pointer rp ( f0h )rc program control flag register flags ( f0h )rb interrupt mask register imr ( f0h )ra interrupt request register irq ( f0h )r9 interrupt priority register ipr ( f0h )r8 reserved ( f0h )r7 port 3 mode register p3m ( f0h )r6 port 2 mode register p2m ( f0h )r5 reserved ( f0h )r4 reserved ( f0h )r3 t1 prescale register pre1 ( f0h )r2 t1 data register t1 ( f0h )r1 t1 mode register tmr ( f0h )r0 reserved table 12. timer control registers (group 0, bank d, registers 0?f) grp/bnk reg register function identifier ( 0dh )rf reserved ( 0dh )re reserved ( 0dh )rd reserved ( 0dh )rc low-battery detect flag lb ( 0dh )rb t16 ms-byte capture register hi8 ( 0dh )ra t16 ls-byte capture register lo8 ( 0dh )r9 t8 high capture register hi16 ( 0dh )r8 t8 low capture register lo16 ( 0dh )r7 t16 ms-byte hold register tc16h ( 0dh )r6 t16 ls-byte hold register tc16l ( 0dh )r5 t8 high hold register tc8h ( 0dh )r4 t8 low hold register tc8l ( 0dh )r3 t8/t16 control register b ctr3 ( 0dh )r2 t16 control register ctr2 ( 0dh )r1 t8/t16 control register a ctr1 ( 0dh )r0 t8 control register ctr0
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 54 register error conditions registers in the z8 standard register file must be used correctly because certain conditions produce inconsistent results and must be avoided. ? registers f5h ? f9h are write-only registers. if an attempt is made to read these registers, ffh is returned. reading any write-only register returns ffh . ? when the register pointer (register fdh) is read, the least significant four bits (lower nibble) indicate the current expanded register file bank. (for example, 0000 indicates the standard register file, while 1010 indicates expanded register file bank a.) ? writing to bits that are selected as timer outputs changes the i/o register but has no effect on the pin signal. ? the z8 instruction djnz uses any general-purpose working register as a counter. ? logical instructions such as or and and require that the current contents of the operand be read. they do not function properly on write-only registers. table 13. smr and port mode registers (group 0, bank f, registers 0?f) grp/bnk reg register function identifier ( 0fh )rf reserved ( 0fh )re reserved ( 0fh )rd reserved ( 0fh )rc reserved ( 0fh )rb stop mode recovery register smr ( 0fh )ra reserved ( 0fh )r9 reserved ( 0fh )r8 adc control register adcctrl ( 0fh )r7 reserved ( 0fh )r6 port 6 mode p6m ( 0fh )r5 port 5 stop mode recovery p5smr ( 0fh )r4 port 5 mode register p5m ( 0fh )r3 reserved ( 0fh )r2 port 4 mode register p4m ( 0fh )r1 port 2 stop mode recovery p2smr ( 0fh )r0 port configuration register p456con
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 55 registers (grouped by function) the following is a summary of the 37 special-purpose registers of the z86d99/ z86l99 family grouped by function. the following are the functional groups: ? flags and pointers ? analog-to-digital converter control ? interrupt control ? i/o port control ? timer control?general-purpose timer (t1) ? timer control?t8 and t16 timers ? stop-mode recovery control for any of the registers described in this section (see table 14), bits identified as ?reserved? either do not exist (meaning they have not been implemented in this design) or have a special purpose in a zilog engineering or test environment. do not attempt to use these bits as the results are unpredictable and meaningless. table 14. register description locations address grp/bnk register register function symbol location 00h r2 (r2) port 2 data p2 page 68 00h r4 (r4) port 4 data p4 page 69 00h r5 (r5) port 5 data p5 page 70 00h r6 (r6) port 6 data p6 page 71 00h r7 (r7) adc data adcdata page 62 0dh r0 t8 timer control ctr0 page 77 0dh r1 t8/t16 control (a) ctr1 page 74 0dh r2 t16 timer control ctr2 page 80 0dh r3 t8/t16 control (b) ctr3 page 76 0dh r4 t8 low load tc8l ? page 79 0dh r5 t8 high load tc8h ? page 79 0dh r6 t16 low load tc16l ? page 82 0dh r7 t16 high load tc16h ? page 82 0dh r8 t16 low capture lo16 ? page 81 0dh r9 t16 high capture hi16 ? page 81 0dh r10 t8 low capture lo8 ? page 78 caution:
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 56 flags and pointer registers in addition to the three standard z8 flag and pointer registers (program control register pointer, and stack pointer), the z86d99/z86l99 family includes a low- battery detect flag register. 0dh r11 t8 high capture hi8 ? page 78 0dh r12 low battery detect lb page 60 0fh r0 port configuration (a) p456con page 67 0fh r1 port 2 smr source p2smr page 84 0fh r2 port 4 mode p4m page 69 0fh r4 port 5 mode p5m page 70 0fh r5 port 5 smr source p5smr page 84 0fh r6 port 6 mode p6m page 71 0fh r8 adc control adcctrl page 61 0fh r11 stop mode recovery smr page 83 f0h r1 (r241) t1 timer mode tmr page 72 f0h r2 (r242) t1 timer data t1 page 72 f0h r3 (r243) t1 timer prescale pre1 page 73 f0h r6 (r246) port 2 mode p2m page 68 f0h r7 (r247) port configuration (b) p3m page 67 f0h r9 (r249) interrupt priority ipr page 64 f0h r10 (r250) interrupt request irq page 65 f0h r11 (r251) interrupt mask imr page 63 f0h r12 (r252) program control flags flags page 57 f0h r13 (r253) register pointer rp page 58 f0h r15 (r255) stack pointer sp page 59 note: ? this register is not reset following stop mode recovery (smr). table 14. register description locations (continued) address grp/bnk register register function symbol location
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 57 program control flag register (flags) the program control flag register (see table 15) reflects the current status of the z8 as shown in table 15. the flags register contains six bits of status informa- tion that are set or cleared by cpu operations. four of the bits (c, v, z, and s) can be tested for use with conditional jump instructions. two flags (h and d) cannot be tested and are used for bcd arithmetic. the two remaining flags in the register (f1 and f2) are available to the user, but they must be set or cleared by instruc- tions and are not usable with conditional jumps. table 15. flags register [group/bank f0h, register c (r252)] bit 765432 1 0 bit/fieldczsvdhf2f1 r/w r/w r/w r/w r/w r/w r/w r/w r/w reset xxxxxx x x r = read, w = write, x = indeterminate bit position bit/field r/w value description 7_______ carry flag (c) r/w 1 indicates the ?carry out? of bit 7 position of a register being used as an accumulator; on rotate and shift instructions this bit contains the most recent value shifted out of the specified register _6______ zero flag (z) r/w 1 indicates that the contents of an accumulator register is zero following an arithmetic or logical operation __5_____ sign flag (s) r/w x stores the value of the most significant bit of a result following an arithmetic, logical, rotate, or shift operation; in arithmetic operations on signed numbers, a positive number is identified by a 0, and a negative number is identified by a 1 ___4____ overflow flag (v) r/w 1 for signed arithmetic, rotate, and shift operations, the flag is set to 1 when the result is greater than the maximum possible number (>127) or less than the minimum possible number (<-128) that can be represented in two?s complement form; following logical operations, this flag is set to 0
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 58 register pointer (rp) z8 instructions can access registers directly or indirectly using either a 4-bit or 8- bit address field. the upper nibble of the register pointer, as described in table 16, contains the base address of the active working register group. the lower nibble contains the base address of the expanded register file bank. when using 4-bit addressing, the 4-bit address of the working register (r0 to rf) is combined with the upper nibble of the register pointer (identifying the wr group), thus forming the 8-bit actual address. ____3___ decimal adjust flag (d) r/w 1 0 used for bcd arithmetic?after a subtraction, the flag is set to 1; following an addition, it is cleared to 0 _____2__ half carry flag (h) r/w 1 0 set to 1, whenever an addition generates a ?carry out? of bit position 3 (overflow) of an accumulator; or subtraction generates a ?borrow into? bit 3 ______1_ user flag (f2) r/w 1 0 user definable _______0 user flag (f1) r/w 1 0 user definable table 16. rp register [group/bank f0h, register d (r253)] bit 765432 1 0 bit/field working register group expanded register file bank r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 7654_____ working register group pointer r/w x identifies 1 of 16 possible wr groups, each containing 16 working registers _____3210 expanded register file bank pointer r/w x identifies 1 of 16 possible erf banks; only banks 0, d, and f are valid for the z86d99/z86l99 family table 15. flags register [group/bank f0h, register c (r252)] (continued)
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 59 stack pointer (sp) the z86d99/z86l99 family of products is configured for an internal stack. the size of the stack is limited only by the available memory space or general-purpose ram registers dedicated to this task. an 8-bit stack pointer, as described in table 17, is used for all stack operations. table 17. sp register [group/bank f0h, register f (r255)] bit 765432 1 0 bit/field stack pointer r/w r/w r/w r/w r/w r/w r/w r/w r/w reset xxxxxx x x r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 stack pointer r/w x points to the data stored on the top of the stack; an overflow or underflow can occur if the stack address is incremented or decremented during normal stack operations
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 60 low-battery detect flag (lb) when the z86d99/z86l99 is used in a battery-operated application, one of the on-chip comparators can be used to check that the v cc is at the required level for correct operation of the device. when voltage begins to approach the v bo point, an on-chip low-battery detection circuit is tripped, which in turn sets a user-read- able flag. the lb register, as described in table 18, is used to set and reset the lb flag. the lb flag will be valid after enabling the detection for 20 s (design estimation, not tested in production). lb does not work at stop mode. it must be disabled during stop mode in order to reduce current. table 18. lb register (group/bank 0dh, register c) bit 765432 1 0 bit/field reserved pad lvd lvd_ flag lvd_ enable r/w wwwwwr/wr/wr/w reset 11111x0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543___ reserved r w 1 x always reads 11111 no effect _____2__ pad lvd r r w 1 0 x pad is not regulated when p43=0 (v pad v min ; see page 33) reset pad lb flag ______1_ lvd_flag r r w 1 0 x lb flag set if v dd z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 61 analog-to-digital converter control registers the z86d99/z86l99 family features an 8-bit analog-to-digital converter with external voltage references. the output of the adc is stored in the adc data register, as shown in table 20. the adc is configured using the adc control register, as shown in table 19. adc control register (adcctrl) the adcctrl register controls the operation of the analog-to-digital converter. bits 2 and 3 of the adcctrl register determine which of the four analog input channels feeds into the adc at any given time. bits 4 through 7 enable or disable the digital input buffer. when configured as an adc input channel, the port has to be configured in input mode and with the digital input buffer disabled. table 19. adcctrl register (group/bank 0fh, register 8) bit 765432 1 0 bit/field p47_ a/d p46_ a/d p45_ a/d p44_ a/d channel selection a/d pwr on adc clock select r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 7_______ p47_a/d r/w 1 0 p47 configured as a/d input p47 configured as digital input _6______ p46_a/d r/w 1 0 p46 configured as a/d input p46 configured as digital input __5_____ p45_a/d r/w 1 0 p45 configured as a/d input p45 configured as digital input ___4____ p44_a/d r/w 1 0 p44 configured as a/d input p44 configured as digital input ____32__ channel selection r/w 11 10 01 00 channel 3 (p47) channel 2 (p46) channel 1 (p45) channel 0 (p44) ______1_ a/d_poweron r/w 1 0 on off _______0 adc clock select r/w 1 0 sclk/2 sclk
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 62 adc data register (adcdata) the adcdata register is a read-only register that contains the digital output of the analog-to-digital converter. see table 20. ) interrupt control registers the z8 allows up to six different interrupts from a variety of sources. these inter- rupts can be masked and their priorities set by using the interrupt mask register and interrupt priority register. the interrupt request register stores the interrupt requests for both vectored and polled interrupts. table 20. adcdata register (group/bank 00h, register 7) bit 765432 1 0 bit/field adc data r/w rrrrrr r r reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 adc data r w data x output of the adc no effect
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 63 interrupt mask register the imr, as described in table 21, individually or globally enables the six interrupt requests. bit 7 of the imr is the master enable and must be set before any of the individual interrupt requests can be recognized. bit 7 must be set and reset by the enable interrupts and disable interrupts instructions only. the imr is automatically reset during an interrupt service routine and set following the execution of an interrupt return (iret) instruction. bit 7 must be reset by the di instruction before the contents of the interrupt mask register or the interrupt priority register are changed except in the following situations: ? immediately after a hardware reset ? immediately after executing an interrupt service routine and before imr bit 7 has been set by any instruction table 21. imr (group/bank 0fh, register b) bit 765432 1 0 bit/field master re- served irq5 irq4 irq3 irq2 irq1 irq0 r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 7_______ master r/w 1 0 enable master interrupt disable master interrupt _6______ reserved r w 1 x always reads 1 no effect __5_____ irq 5 r/w 1 0 enable irq 5 disable irq 5 ___4____ irq 4 r/w 1 0 enable irq 4 disable irq 4 ____3___ irq 3 r/w 1 0 enable irq 3 disable irq 3 _____2__ irq 2 r/w 1 0 enable irq 2 disable irq 2 ______1_ irq 1 r/w 1 0 enable irq 1 disable irq 1 _______0 irq 0 r/w 1 0 enable irq 0 disable irq 0 note:
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 64 interrupt priority register (ipr) the ipr, as described in table 22, is a write-only register that sets priorities for the vectored interrupts in order to resolve simultaneous interrupt requests. there are 48 sequence possibilities for interrupts. the six interrupts, irq 0 to irq 5 , are divided into three groups of two interrupt requests each, as follows: ? group a consists of irq 3 and irq 5 ? group b consists of irq 0 and irq 2 ? group c consists of irq 1 and irq 4 ) priorities can be set both within and between groups using the ipr. bits 1, 2, and 5 of the ipr define the priority of individual members within the groups. bits 0, 3, and 4 are encoded to define six priority orders between the three groups. bits 6 and 7 are reserved. table 22. ipr (group/bank 0fh, register 9) bit 765432 1 0 bit/field reserved grp a irq3_5 int_group grp b irq0_2 grp c irq1_4 int_ group r/w wwwwww w w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76______ reserved w x no effect __5_____ grp a priority: irq 3 and irq 5 w1 0 irq 3 >irq 5 (group a) irq 5 >irq 3 ___43__0 interrupt group priority w 111 110 101 100 011 010 001 000 reserved b>a>c c>b>a b>c>a a>c>b a>b>c c>a>b reserved _____2__ grp b priority: irq 0 and irq 2 w1 0 irq 0 >irq 2 (group b) irq 2 >irq 0 ______1_ grp c priority: irq 1 and irq 4 w1 0 irq 4 >irq 1 (group c) irq 1 >irq 4
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 65 interrupt request register the irq, as described in table 23, is a read/write register that stores the interrupt requests for both vectored and polled interrupts. when an interrupt request is made by any of the six interrupts, the corresponding bit in the irq is set to 1. table 23. irq (group/bank 0fh, register a) bit 765432 1 0 bit/field interrupt edge set irq5 set irq4 set irq3 set irq2 set irq1 set irq0 r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76______ interrupt edge trigger r/w 11 10 01 00 p51 rise/fallingp52 rise/falling p51 rising p52 falling p51 fallingp52 rising p51 fallingp52 falling __5_____ set irq 5 r r w w 1 0 1 0 irq 5 inactive irq 5 active set irq 5 reset irq 5 ___4____ set irq 4 r r w w 1 0 1 0 irq 4 inactive irq 4 active set irq 4 reset irq 4 ____3___ set irq 3 r r w w 1 0 1 0 irq 3 inactive irq 3 active set irq 3 reset irq 3 _____2__ set irq 2 r r w w 1 0 1 0 irq 2 inactive irq 2 active set irq 2 reset irq 2 ______1_ set irq 1 r r w w 1 0 1 0 irq 1 inactive irq 1 active set irq 1 reset irq 1 _______0 set irq 0 r r w w 1 0 1 0 irq 0 inactive irq 0 active set irq 0 reset irq 0
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 66 whenever a power-on reset is executed, the irq is reset to 00h and disabled. before the irq accepts requests, it must be enabled by executing an enable inter- rupts instruction. irq is always cleared to 00h and is in read-only mode until the first ei instruction that enables the irq to be read/write. setting the global interrupt enable bit in the interrupt mask register (imr bit 7) does not enable the irq. execution of an ei instruction is required. for polled processing, irq must be initialized by an ei instruction. to properly ini- tialize the irq, the following code is provided: clr imr ; make sure vectored interrupts are disabled ei ; enable irq, otherwise it is read only ; not necessary, if interrupts were previously ; enabled di ; disable interrupt handling imr is cleared before the irq enabling sequence to ensure no unexpected inter- rupts occur when ei is executed. this code sequence must be executed before programming the application required values for ipr and imr. i/o port control registers each of the four ports (ports 2, 4, 5, and 6) has an input register, an output regis- ter, and an associated buffer and control logic. because there are separate input and output registers associated with each port, writing bits defined as inputs stores the data in the output register. this data cannot be read as long as the bits are defined as inputs. however, if the bits are reconfigured as output, the data stored in the output register is reflected on the output pins and can then be read. this mechanism allows the user to initialize the outputs before driving their loads. note:
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 67 port configuration registers (p456con and p3m) the port configuration register (described in table 24) switches the comparator inputs from digital to analog and allows ports 4, 5, and/or 6 to be switched from push/pull active outputs to open drain outputs. in zilog test mode, bit 3 of this register is used to enable the address strobe/data strobe. bit 3 is not available in user mode. port 2 outputs are configured using the p3m register, shown in table 25. bit 0 of the p3m register switches port 2 from push/pull active to open drain outputs. no other bits in this register are implemented. table 24. p456con register (group/bank 0fh, register 0) bit 76543 210 bit/field not used p51_ mode p52_ mode reserved p6_ output p5_ output p4_ output r/w r/w r/w r/w r/w r/w w w w reset 00000 1 1 1 ? r = read, w = write, x = indeterminate bit position bit/field r/w value description 76______ not used r/w these bits exist but do not have any function assigned to them; they are reserved for future extensions and must not be used. __5_____ comparator 1 mode r/w 1 0 analog (p50, p51 as inputs) digital inputs ___4____ comparator 2 mode r/w 1 0 analog comparator inputs (p52, p53 configured as inputs) digital inputs ____3___ reserved _____2__ port 6 output configuration w1 0 push-pull active open drain outputs always reads back 1 * ______1_ port 5 output configuration w1 0 push-pull active open drain outputs always reads back 1 * _______0 port 4 output configuration w1 0 push-pull active open drain outputs always reads back 1 * ? note: *do not use the read-modify-write instructions (for example, or and and) with this register. bits 0, 1, and 2 always read back 1. note: ? for Z86L990/l991, p43 can never be configured as push-pull. after any reset, p43 is configured as tristate high impedance.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 68 port 2 control and mode registers (p2 and p2m) port 2 is a general-purpose 8-bit, bidirectional i/o port, as shown in table 26. each of the eight port 2 i/o lines can be independently programmed as either input or output using the port 2 mode register (see table 27.) table 25. p3m register [group/bank f0h, register 7 (r247)] bit 765432 1 0 bit/field reserved p2_ output r/w wwwwww w w reset 111111 1 1 r = read, w = write, x = indeterminate bit position bit/field r/w value description 7654321_ reserved r w 1 x always reads 1111111 no effect _________0 port 2 output configuration w1 0 push-pull active open drain outputs table 26. p2 register [group/bank 00h, register 2 (r2)] bit 765432 1 0 bit/field port 2 data r/w r/w r/w r/w r/w r/w r/w r/w r/w reset xxxxxx x x r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 port 2 data r/w data port 2 input/output register table 27. p2m register [group/bank f0h, register 6 (r246)] bit 765432 1 0 bit/field p27m p26m p25m p24m p23m p22m p21m p20m r/w wwwwww w w reset 111111 1 1 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 (by bit) port 2 mode select r w w 1 1 0 always reads 11111111 input output
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 69 a bit set to 1 in the p2m register configures the corresponding bit in port 2 as an input, while a bit set to 0 configures an output line. port 4 control and mode registers (p4 and p4m) port 4 is a general-purpose 8-bit, bidirectional i/o port, as shown in table 28. each of the eight port 4 i/o lines can be independently programmed as either input or output using the port 4 mode register (see table 29.) . a bit set to 1 in the p4m register configures the corresponding bit in port 4 as an input, while a bit set to 0 configures an output line. p43, the controlled current output pad, cannot be configured as an input. (p43 read = p43 out) table 28. p4 register [group/bank 00h, register 4 (r4)] bit 765432 1 0 bit/field port 4 data r/w r/w r/w r/w r/w r/w r/w r/w r/w reset xxxxxx x x r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 port 4 data r/w data port 4 input/output register table 29. p4m register (group/bank 0fh, register 2) bit 765432 1 0 bit/field p47m p46m p45m p44m p43m p42m p41m p40m r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 111111 1 1 r = read, w = write, x = indeterminate bit position bit/field r/w value description 7654_210 (by bit) port 4 mode select r/w 1 0 input output ____3___ p43 mode select r/w 0 1 output tristate high impedance (available on Z86L990/l991 only) note:
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 70 port 5 control and mode registers (p5 and p5m) port 5 is a general-purpose 8-bit, bidirectional i/o port, as shown in table 30. each of the eight port 5 i/o lines can be independently programmed as either input or output using the port 5 mode register (see table 31.) a bit set to a 1 in the p5m register configures the corresponding bit in port 5 as an input, while a bit set to 0 configures an output line. regardless of how p5m bits 2 and 3 are set, p52 and p53 are always in input mode. table 30. p5 register [group/bank 00h, register 5 (r5)] bit 765432 1 0 bit/field port 5 data r/w r/w r/w r/w r/w r/w r/w r/w r/w reset xxxxxx x x r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 port 5 data r/w data port 5 input/output register table 31. p5m register (group/bank 0fh, register 4) bit 765432 1 0 bit/field p57m p56m p55m p54m p53m p52m p51m p50m r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 111111 1 1 r = read, w = write, x = indeterminate bit position bit/field r/w value description 7654__10 (by bit) port 5 mode select r/w 1 0 input output ____32__ p53, p52 mode select r/w 1 input regardless of what is written to this pin, p53 and p52 are always in input mode. note:
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 71 port 6 control and mode registers (p6 and p6m) port 6 is a general-purpose 8-bit, bidirectional i/o port, as shown in table 32. each of the eight port 6 i/o lines can be independently programmed as either input or output using the port 6 mode register (see table 33.) a bit set to 1 in the p6m register configures the corresponding bit in port 6 as an input, while a bit set to 0 configures an output line. timer control registers?general-purpose timer (t1) the z86d99/z86l99 family provides one standard 8-bit z8 counter/timer, t1, driven by its own 6-bit prescaler, pre1. t1 is independent of the processor instruction sequence, relieving software from time-critical operations such as interval timing or event counting. there are three registers that control the opera- tion of t1: t1 data register (t1), t1 mode register (tmr), and t1 prescale reg- ister (pre1). because the timer, prescaler, and mode register are mapped into the standard z8 register file, the software can treat the counter/timer as a general- purpose register, thus eliminating the requirement for special instructions. table 32. p6 register [group/bank 00h, register 6 (r6)] bit 765432 1 0 bit/field port 6 data r/w r/w r/w r/w r/w r/w r/w r/w r/w reset xxxxxx x x r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 port 6 data r/w data port 6 input/output register table 33. p6m register (group/bank 0fh, register 6) bit 765432 1 0 bit/field p67m p66m p65m p64m p63m p62m p61m p60m r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 111111 1 1 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 (by bit) port 6 mode select r/w 1 0 input output
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 72 t1 data register (t1) the counter/timer register (t1) consists of an 8-bit down counter, a write-only reg- ister that holds the initial count value, and a read-only register that holds the cur- rent count value. the initial value of t1 can range from 1 to 255 (0 represents 256) (see table 34.) t1 mode register (tmr) under software control, t1 counter/timer is started and stopped using the t1 mode register as shown in table 35. table 34. t1 register [group/bank f0h, register 2 (r242)] bit 765432 1 0 bit/field t1_value r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 t 1 value r w data data current value initial value (range 1 to 256 decimal) table 35. tmr register [group/bank f0h, register 1 (r241)] bit 765432 1 0 bit/field tout_mode tin_mode t1_ count t1_ load reserved r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 11 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76______ t out mode r/w 11 10 01 00 internal clock out on p56 t 1 out on p56 reserved not used (p56 configured as i/o) __54____ t in mode r/w 11 10 01 00 trigger input (retriggerable) trigger input (not-retriggerable) gate input external clock input (t in on p52) ____3___ t 1 count r/w 1 0 enable t 1 count disable t 1 count
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 73 t1 prescale register (pre1) the t1 prescaler consists of an 8-bit register and a 6-bit down-counter. the six most significant bits (d2?d7) of pre1 hold the prescaler?s count modulo, a value from 1 to 64 decimal, as shown in table 36. the prescale register also contains control bits that specify the counting mode and clock source for t1. timer control registers?t8 and t16 timers one of the unique features of the z86d99/z86l99 family is a special timer archi- tecture to automate the generation and reception of complex pulses or signals. this timer architecture consists of one programmable 8-bit counter timer with two capture registers and two load registers and a programmable 16-bit counter/timer with one 16-bit capture register pair and one 16-bit load register pair and their associated control registers. these counter/timers can work independently or can be combined together using a number of user-selectable modes governed by the t8/t16 control registers. _____2__ t 1 load r/w 1 0 load t 1 no effect ______10 reserved r w 1 x always reads 11 no effect table 36. pre1 register [group/bank f0h, register 3 (r243)] bit 765432 1 0 bit/field prescaler_modulo clock_ source count_ mode r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 00 r = read, w = write, x = indeterminate bit position bit/field r/w value description 765432__ prescaler modulo r/w data range: 1 to 64 decimal _______1_ clock source r/w 1 0 t 1 internal t 1 external (t in on p52) ________0 count mode r/w 1 0 t 1 modulo-n t 1 single pass table 35. tmr register [group/bank f0h, register 1 (r241)] (continued)
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 74 t8/t16 control register a (ctr1) the t8/t16 control register a controls the functions in common with both the t 8 and t 16 counter/timers. the t 8 and t 16 counter/timers have two primary modes of operation: transmit mode and demodulation mode. transmit mode is used for generating complex waveforms. the transmit mode has two submodes: normal mode and ping-pong mode. the settings for ctr1 in transmit mode are given in table 37. table 37. ctr1 register (in transmit mode) (group/bank 0dh, register 1) bit 765432 1 0 bit/field mode p43 out t8/t16_logic transmit_ submode initial_ t8_out initial_ t16_ out r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 00 r = read, w = write, x = indeterminate bit position bit/field r/w value description 7_______ mode r/w 1 0 demodulation transmit _6______ p43_out r/w 1 0 p43 configured as t8/t16 output p43 configured as i/o __54____ t 8 /t 16 logic r/w 11 10 01 00 nand nor or and ____32__ transmit_ submode r/w 11 10 01 00 t16_out = 1 t16_out = 0 ping-pong mode normal operation ______1_ initial_t8_out r/w 1 0 t8_out set to 1 initially t8_out set to 0 initially _______0 initial_t16_out r/w 1 0 t16_out set to 1 initially t16_out set to 0 initially
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 75 in demodulation mode, the t8 and t16 counter/timers are used to capture and demodulate complex waveforms. the settings for ctr1 in demodulation mode are given in table 38. table 38. ctr1 register (in demodulation mode) (group/bank 0dh, register 1) bit 765432 1 0 bit/field mode demod _input edge_detect glitch_filter rising edge falling edge r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 00 r = read, w = write, x = indeterminate bit position bit/field r/w value description 7_______ mode r/w 1 0 demodulation transmit _6______ demodulator_ input r/w 1 0 p20 as demodulator input p51 as demodulator input __54____ edge_detect r/w 11 10 01 00 reserved both edges rising edge falling edge ____32__ glitch_filter r/w 11 10 01 00 16 sclk cycles 8 sclk cycles 4 sclk cycles no filter ______1_ rising_edge r r w w 1 0 1 0 rising edge detected no rising edge reset flag to 0 no effect _______0 falling_edge r r w w 1 0 1 0 falling edge detected no falling edge reset flag to 0 no effect
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 76 t8/t16 control register b (ctr3) the t8/t16 control register b, known as ctr3, is a new register to the z86d99/ z86l99 family. this register allows the t 8 and t 16 counters to be synchronized. the settings of ctr3 are described in table 39. table 39. ctr3 register (group/bank 0dh, register 3) bit 765432 1 0 bit/field t16_ enable t8_ enable sync mode reserved r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000xxx xx r = read, w = write, x = indeterminate bit position bit/field r/w value description 7_______ t 16 enable r r w w 1 0 1 0 counter enabled counter disabled enable counter stop counter _6______ t 8 enable r r w w 1 0 1 0 counter enabled counter disabled enable counter stop counter __5_____ sync mode r/w 1 0 enable sync mode diable sync mode ___43210 reserved r w 1 x always reads 11111 no effect
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 77 t8 control register (ctr0) as shown in table 40, the t8 control register, known as ctr0, controls the oper- ation of the 8-bit t 8 timer. table 40. ctr0 register (group/bank 0dh, register 0) bit 765432 1 0 bit/field t8_ enable single/ mod- ulo-n time_ out t8_clock capture int_ mask counter int_ mask p40_ out r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 00 r = read, w = write, x = indeterminate bit position bit/field r/w value description 7_______ t 8 enable r r w w 1 0 1 0 counter enabled counter disabled enable counter stop counter _6______ single/ modulo-n r/w 1 0 single pass modulo-n __5_____ time_out r r w w 1 0 1 0 counter timeout occurred no counter timeout reset flag to 0 no effect ___43___ t 8 clock r/w 11 10 01 00 sclk/8 sclk/4 sclk/2 sclk _____2__ capture interrupt mask r/w 1 0 enable data capture interrupt disable data capture interrupt ______1_ counter interrupt mask r/w 1 0 enable time_out interrupt disable time_out interrupt _______0 p40_out r/w 1 0 p40 configured as t 8 output p40 configured as i/o
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 78 t8 high capture register (hi8) the t8 high capture register, as described in table 41, holds the captured data from the output of the t 8 counter/timer. this register is typically used to hold the number of counts when the input signal is high (or 1 ). t8 low capture register (lo8) the t8 low capture register, as described in table 42, holds the captured data from the output of the t 8 counter/timer. this register is typically used to hold the number of counts when the input signal is low (or 0 ). table 41. hi8 register (group/bank 0dh, register b) bit 765432 1 0 bit/field t8_capture_hi r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 t 8 capture high value r w data captured data no effect table 42. lo8 register (group/bank 0dh, register a) bit 765432 1 0 bit/field t8_capture_lo r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 t 8 capture low value r w data captured data no effect
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 79 t8 high load register (tc8h) the t8 high load register, as described in table 43, is loaded with the counter value necessary to keep the t8_out signal in the high state for the required time. t8 low load register (tc8l) the t8 low load register, as described in table 44, is loaded with the counter value necessary to keep the t8_out signal in the low state for the required time. table 43. tc8h register (group/bank 0dh, register 5) bit 765432 1 0 bit/field t8_level_hi r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 t 8 level high value r/w data duration that t8_out remains high table 44. tc8l register (group/bank 0dh, register 4) bit 765432 1 0 bit/field t8_level_lo r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 t 8 level low value r/w data duration that t8_out remains low
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 80 t16 control register (ctr2) the t16 control register, known as ctr2, controls the operation of the 16-bit t 16 timer (see table 45). table 45. ctr2 register (group/bank 0dh, register 2) bit 765432 1 0 bit/field t16_ enable single/ mod- ulo-n time_ out t16_clock capture int_ mask counter int_ mask p41_ out r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 00 r = read, w = write, x = indeterminate bit position bit/field r/w value description 7_______ t 16 enable r r w w 1 0 1 0 counter enabled counter disabled enable counter stop counter _6______ single/ modulo-n r/w 1 0 1 0 in transmit mode: single pass modulo-n in demodulation mode: t 16 does not recognize edge t 16 recognizes edge __5_____ time_out r r w w 1 0 1 0 counter timeout occurred no counter timeout reset flag to 0 no effect ___43___ t 16 clock r/w 11 10 01 00 sclk/8 sclk/4 sclk/2 sclk _____2__ capture interrupt mask r/w 1 0 enable data capture interrupt disable data capture interrupt ______1_ counter interrupt mask r/w 1 0 enable time_out interrupt disable time_out interrupt _______0 p41_out r/w 1 0 p41 configured as t 16 output p41 configured as i/o
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 81 t16 ms-byte capture register (hi16) the t16 ms-byte capture register, as described in table 46, holds the captured data from the output of the t 16 counter/timer. this register holds the most signifi- cant byte of the data. t16 ls-byte capture register (lo16) the t16 ls-byte capture register, as described in table 47, holds the captured data from the output of the t 16 counter/timer. this register holds the least signifi- cant byte of the data. table 46. hi16 register (group/bank 0dh, register 9) bit 765432 1 0 bit/field t16_capture_hi r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 t 16 capture hi r w data ms-byte of captured data no effect table 47. lo16 register (group/bank 0dh, register 8) bit 765432 1 0 bit/field t16_capture_lo r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 t 16 capture lo r w data ls-byte of captured data no effect
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 82 t16 ms-byte load register (tc16h) the t16 ms-byte load register, as described in table 48, is loaded with the most significant byte of the t 16 counter value. t16 ls-byte load register (tc16l) the t16 ls-byte load register, as described in table 49, is loaded with the least significant byte of the t 16 counter value. stop-mode recovery control registers the z86d99/z86l99 family of products allows 16 individual i/o pins (ports 2 and 5) to be used as a stop-mode recovery sources. the stop mode is exited when one of these smr sources is toggled. table 48. tc16h register (group/bank 0dh, register 7) bit 765432 1 0 bit/field t16_data_hi r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 t 16 data hi r/w data ms-byte of the t 16 counter table 49. tc16l register (group/bank 0dh, register 6) bit 765432 1 0 bit/field t16_data_lo r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 t 16 data lo r/w data ls-byte of the t 16 counter
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 83 stop-mode recovery register the smr register serves two functions. bit d7 of the smr register, as shown in table 50, is the stop mode flag that is set upon entering stop mode. a 0 in this bit indicates that the device has been reset by a por or wdt reset. a por or wdt reset is sometimes referred to as a ?cold? start. a 1 in bit d7 indicates that the device was awakened by a smr source. waking a device with a smr source is sometimes referred to as a ?warm? start. the stop mode recovery source can be selected by any combination of p2 and p5 by p2smr and p5smr, respectively. if the pin is selected as the smr source, its logic level is latched into a register. a wait up signal is generated if its logic level changes. this applies to all selected pins for the smr source. the comparators of p5 cannot be used as an smr source. the comparator is turned off in stop mode. the second function of the smr register is the selection of the external clock divide value. the purpose of this control is to selectively reduce device power table 50. smr register (group/bank 0fh, register b) bit 765432 1 0 bit/field stop flag re- served stop delay reserved sclk select r/w r r/w w r/w r/w r/w w w reset 001000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 7_______ stop mode flag r r w 1 0 x stop recovery (warm start) por/wdt reset (cold start) no effect _6______ reserved r w 1 x always reads 1 no effect __5_____ stop delay r w w 1 1 0 always reads 1 enable 5ms /reset delay disable /reset delay after smr ___432__ reserved r w 1 x always reads 111 no effect _______10 system clock select r w w w w 11 11 10 01 00 always reads 11 sclk, tclk = xtal/16 sclk, tclk = xtal sclk, tclk = xtal/32 sclk, tclk = xtal/2
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 84 consumption during normal processor execution (sclk control) and/or halt mode (where tclk sources counter/timers and interrupt logic). port 2 stop mode recovery (p2smr) the p2smr register, as described in table 51, defines which i/o lines in port 2 are to be used as stop mode recovery sources. port 5 stop-mode recovery (p5smr) the p5smr register, as described in table 52, defines which i/o lines in port 5 are to be used as stop-mode recovery sources. table 51. p2smr register (group/bank 0fh, register 1) bit 765432 1 0 bit/field p27rs p26rs p25rs p24rs p23rs p22rs p21rs p20rs r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 (by bit) port 2 stop mode recovery r/w 1 0 recovery source not table 52. p5smr register (group/bank 0fh, register 5) bit 765432 1 0 bit/field p57rs p56rs p55rs p54rs p53rs p52rs p51rs p50rs r/w r/w r/w r/w r/w r/w r/w r/w r/w reset 000000 0 0 r = read, w = write, x = indeterminate bit position bit/field r/w value description 76543210 (by bit) port 5 stop mode recovery r/w 1 0 recovery source not
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 85 electrical characteristics this section covers the absolute maximum ratings, standard test conditions, dc characteristics, and ac characteristics. absolute maximum ratings table 53 lists the absolute maximum ratings. stresses greater than those listed in the preceding table can cause permanent damage to the device. this rating is a stress rating only. functional operation of the device at any condition above those indicated in the operational sections of these specifications is not implied. exposure to absolute maximum rating condi- tions for an extended period can affect device reliability. standard test conditions the characteristics listed below apply for standard test conditions as noted. all voltages are referenced to gnd. positive current flows into the referenced pin (see figure 36). table 53. absolute maximum ratings symbol description min max units v max supply voltage (*) ?0.3 +7.0 v t stg storage temp. ?65 +150 c t a oper. ambient temp. ? c v ram minimum ram voltage 1.0 v** note: *voltage on all pins with respect to gnd. ?see ?ordering information? on page 95. ** estimated value, not tested.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 86 figure 36. test load diagram dc characteristics table 54 lists the dc characteristics for the z86d99x (otp only). table 55 lists the dc characteristics for the z86l99x (mask only). from output under test i 150pf
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 87 table 54. dc characteristics for the z86d99x (otp only) symbol parameter v dd min max units comments v dd power supply voltage 3 5.5 v ch clock input high voltage 3.0 v 5.5 v 0.8vdd 0.8vdd vdd+0.3 vdd+0.3 v v driven by ext. clock generator v cl clock input low voltage 3.0 v 5.5 v vss?0.3 vss?0.3 0.2vdd 0.2vdd driven by ext. clock generator v ih input high voltage 3.0 v 5.5 v 0.7vdd 0.7vdd vdd+0.3 vdd+0.3 v v v il input low voltage 3.0 v 5.5 v vss?0.3 vss?0.3 0.2vdd 0.2vdd v v v oh1 output high voltage regular i/o 3.0 v 5.5 v v dd ?0.8 v dd ?0.8 v v ?1.2 ma v oh2 high drive pins (p54, p55, p56, p57) 3.0 v 5.5 v v dd ?0.8 v dd ?0.8 v v ?5.0 ma v ol1 regular i/o output low voltage 3.0 v 5.5 v 0.4 0.8 v v 2 ma 4.0 ma v ol2 high drive pins (p54, p55, p56, p57) 3.0 v 5.5 v 0.4 0.8 v v 4 ma 7.0 ma i cco controlled current output (p43) 3.0 v 5.5 v 70 70 120 120 ma ma vout = 1.2 v to vdd (see figure 17) i il input leakage 3.0 v 5.5 v ?1 ?1 1 a 1 a a a vin=0 v, vdd vin=0 v, vdd i cc supply current 3.0 v 5.5 v 3.0 v 5.5 v 10 15 250 850 ma ma a a at 8 mhz at 8 mhz at 32 khz at 32 khz adc is off. i cc1 standby current (halt mode) 3.0 v 5.5 v 3.0 v 5.5 v 3 5 2 4 ma ma ma ma vin=0 v, vdd at 8 mhz clock divided by 16 xtal running adc is off. i cc2 standby current (stop mode) 3.0 v 5.5 v 20 30 a a vin=0 v, vdd; adc is off. p43=1 or high impedance wdt, comparators, low voltage detection, and adc (if applicable) are disabled. the ic might draw more current if any of the above peripherals is enabled. i adc current with a/d running 3.0 v 5.5 v 500 900 a a v lv vdd low-voltage protection 2.90 v low voltage protection is also known as brownout. typical is 2.6 v. v lb low-battery detection vlv+ 0.5 v v
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 88 table 55. dc characteristics for the z86l99x (mask only) symbol parameter v dd min max units comments v dd power supply voltage 2.3 5.5 v ch clock input high voltage 2.3 v 5.5 v 0.8vdd 0.8vdd vdd+0.3 vdd+0.3 v v driven by ext. clock generator v cl clock input low voltage 2.3 v 5.5 v vss?0.3 vss?0.3 0.2vdd 0.2vdd driven by ext. clock generator v ih input high voltage 2.3 v 5.5 v 0.7vdd 0.7vdd vdd+0.3 vdd+0.3 v v v il input low voltage 2.3 v 5.5 v vss?0.3 vss?0.3 0.2vdd 0.2vdd v v v oh1 output high voltage regular i/o 2.3 v 5.5 v 2.0 5.0 v v ?0.5 ma 2.3 v 5.5 v 1.9 5.0 v v ?1.2 ma v oh2 high drive pins (p54, p55, p56, p57) 2.3 v 5.5 v 1.9 5.1 v v ?3 ma 2.3 v 5.5 v 1.7 4.7 v v ?5 ma v ol1 regular i/o output low voltage 2.3 v 5.5 v 0.4 v 0.4 v v v 2 ma 2.3 v 5.5 v 0.8 v 0.8 v v v 4 ma v ol2 high drive pins (p54, p55, p56, p57) 2.3 v 5.5 v 0.4 v 0.4 v v v 4 ma 2.3 v 5.5 v 0.8 v 0.8 v v v 7 ma i cco controlled current output (p43) 2.3 v 5.5 v 70 70 120 120 ma ma vout = 1.2 v to vdd at room temperature (see figure 17) i il input leakage 2.3 v 5.5 v ?1 ?1 1 a 1 a a a vin=0 v, vdd vin=0 v, vdd i cc supply current 2.3 v 5.5 v 2.3 v 5.5 v 3 8 250 850 ma ma a a at 8 mhz at 8 mhz at 32 khz at 32 khz adc is off. i cc1 standby current (halt mode) 2.3 v 5.5 v 2 5 ma ma vin=0 v, vdd at 8 mhz i cc2 standby current (stop mode) 2.3 v 5.5 v 8 25.0 a a vin=0 v, vdd;adc is off. wdt, comparators, low voltage detection, and adc (if applicable) are disabled. the ic might draw more current if any of the above peripherals is enabled. i cc2 standby current (stop mode) 5.5 v 15 a at 30 c i lv standby current (low voltage) 20 a measured at v dd =v lv ?0.2 v. i adc current with a/d running 2.3 v 5.5 v 500 900 a a v lv vdd low-voltage protection 2.2 v low voltage protection is also known as brownout. typical is around 1.7 v at room temperature. v lb low-battery detection 3.0 v typical is around 2.4 v at room temperature.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 89 analog-to-digital converter characteristics table 56 lists the analog-to-digital converter characteristics. the adc input is a switching capacitor that charges up to the applied input volt- age whenever it is configured as an adc input. if you switch it from digital mode to table 56. analog-to-digital converter characteristics parameter minimum typical maximum units resolution 8bits integral nonlinearity 0.5 1 lsb differential nonlinearity 0.5 1 lsb zero error at 25 c7.8mv supply voltage range (otp) 3.0 5.5 v supply voltage range (rom) 2.3 5.5 v power dissipation (no load) 1.2 mw clock frequency (f adc) 4 mhz input voltage range v ref? v ref+ v step response 2/(0.0021 x f adc) s adc input capacitance 25 40 pf vref input capacitance 25 40 pf v ref+ range v ref? +2.0 av dd v v ref? range agnd v ref+ ?2.0 v (v ref+ )?(v ref? )2.0 av dd v temperature range 0 70 c 3-db frequency (0.0021 x f adc) hz signal to noise 47 db adc output code dout vref input source impedance 1.0 kohms adc input source impedance 1.0 kohms notes: dout= [(vin?v ref? )/(v ref+ ?v ref? )] x 256 f adc = set in adcctrl configuration register step response is the time to track the input if a step from v ref? to v ref+ is applied.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 90 the adc input mode, the switching capacitor starts to charge up from 0 v. for the maximum swing (dout = 0 to ff), it takes 2/(0.0021x f adc). for an 8-mhz mcu crystal (with clock divide-by-two mode), the internal system clock is 4 mhz. in adcctrl, if you select the adc frequency = system clock divided by 1 option, f adc = 4 mhz. the step response = 238 us. ac characteristics table 57 lists the ac characteristics. table 57. ac characteristics no. symbol parameter vdd min max units 1 tpc input clock period 2.3 v 5.5 v 120 120 dc dc ns 2 trc, tfc clock input rise and fall times 2.3 v 5.5 v 25 ns 25 ns 3 twc input clock width 2.3 v 5.5 v 5.0 5.0 ns ns 4 twtinl timer input low width 2.3 v 5.5 v 2tpc 2tpc ns 5 twtinh timer input high width 2.3 v 5.5 v 2 2 tpc tpc 6 tpt1in timer 1 input period 2.3 v 5.5 v 8 8 tpc tpc 7 trtin, tftin timer input rise and fall time 2.3 v 5.5 v 100 100 ns ns 8 twil interrupt request low time 2.3 v 5.5 v 100 70 ns ns 9 twih interrupt request input high time 2.3 v 5.5 v 5 5 tpc tpc 10 twsm stop-mode recovery width spec 2.3 v 5.5 v 12 12 ns ns 12 twdt watch-dog timer time out 2.3 v 5.5 v 25 10 ms ms
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 91 packaging figure 37 through figure 40 show the available packages. figure 37. 48-pin ssop controlling dimensions : mm leads are coplanar within .004 inch d e h a1 a2 a e seating plane b 48 25 c detail a detail a 0-8? l 1 24
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 92 figure 38. 40-pin pdip figure 39. 28-pin pdip
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 93 figure 40. 28-pin soic
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 94 design considerations the z8 uses a pierce oscillator with an internal feedback circuit. the advantages of this circuit are low cost, large output signal, low-power level in the crystal, stabil- ity with respect to v cc and temperature, and low impedances (not disturbed by stray effects.) one drawback is the requirement for high gain in the amplifier to compensate for feedback path losses. traces connecting crystal, capacitors, and the z8 oscillator pins must be as short and wide as possible. short and wide traces reduce para- sitic inductance and resistance. the components (capacitors, crystal, and resis- tors) must be placed as close as possible to the oscillator pins of the z8. the traces from the oscillator pins of the integrated circuit (ic) and the ground side of the lead capacitors must be guarded from all other traces (clock, v cc , and system ground) to reduce cross-talk and noise injection. guarding the traces is usually accomplished by keeping other traces and system ground trace planes away from the oscillator circuit and by placing a z8 device v ss ground ring around the traces/components. the ground side of the oscillator lead capacitors must be connected to a single trace to the z8 v ss (gnd) pin. it must not be shared with any other system ground trace or components except at the z8 device v ss pin. not sharing the ground side of the oscillator lead capacitors is to prevent differen- tial system ground noise injection into the oscillator.
z86d990/z86d991 otp and z86l99x rom low-voltage microcontrollers with adc ps003807-1002 p r e l i m i n a r y 95 ordering information for fast results, contact your local zilog sale offices for assistance in ordering part(s). updated information can be found on the zilog website: http :// www .z i log. com precharacterization product the product represented by this document is newly introduced and zilog has not completed the full characterization of the product. the document states what zilog knows about this product at this time, but additional features or nonconfor- mance with some aspects of the document might be found, either by zilog or its customers in the course of further application and characterization work. in addi- tion, zilog cautions that delivery might be uncertain at times, due to start-up yield issues. zilog, inc. 532 race street san jose, ca 95126-3432 telephone: (408) 558-8500 fax: 408 558-8300 internet: http :// www .z i log. com part psi description z86d99 (otp) z86d990pz008sc z86d990hz008sc z86d991pz008sc z86d991sz008sc 40-pin pdip 48-pin ssop 28-pin pdip 28-pin soic z86l99 (mask rom) Z86L990pz008sc Z86L990hz008sc z86l991pz008sc z86l991sz008sc z86l996pz008sc z86l996sz008sc z86l997pz008sc z86l997sz008sc 40-pin pdip 48-pin ssop 28-pin pdip 28-pin soic 28-pin pdip 28-pin soic 28-pin pdip 28-pin soic emulator Z86L9900100zem emulator/programmer adapter z86d9900100zdh 48 ssop adapter evaluation board Z86L9900100zco evaluation board


▲Up To Search▲   

 
Price & Availability of Z86L990

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X